笔者使用的是mac系统,因此介绍mac下golang的环境搭建。
1、安装Golang的SDK
google官网被墙下载地址如下: http://www.golangtc.com/download ,下载最新的安装包,之后双击安装即可。
安装完成之后,打开终端,输入go、或者go version(查看安装版本)出现如下信息即表示安装成功:
LCore:~ lcore$ go version
go version go1.4.1 darwin/amd64
LCore:~ lcore$
2、配置环境变量
安装完sdk之后接下来便是配置环境变量了,打开终端输入cd ~ 进入用户主目录,之后输入ls -all命令查看是否存在.bash_profile
文件,存在既使用vim .bash_profile打开并编辑该文件。根据自己实际情况,内容如下:
export GOPATH=/Users/lcore/dev/code/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
GOPATH:日常开发的根目录。GOBIN:是GOPATH下的bin目录。
且需要gobin目录加入到path路径下,生成的可执行文件就可以直接运行了。
退出vim,使用source ~/.bash_profile即可完成对golang环境变量的配置了,可以在终端中输入go env查看配置后的效果:
LCore:~ lcore$ go env
GOARCH=”amd64″
GOBIN=”/Users/lcore/dev/code/go/bin”
GOCHAR=”6″
GOEXE=””
GOHOSTARCH=”amd64″
GOHOSTOS=”darwin”
GOOS=”darwin”
GOPATH=”/Users/lcore/dev/code/go”
GORACE=””
GOROOT=”/usr/local/go”
GOTOOLDIR=”/usr/local/go/pkg/tool/darwin_amd64″
CC=”clang”
GOGCCFLAGS=”-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common”
CXX=”clang++”
CGO_ENABLED=”1″
3、开发工具配置(sublime text)
这里笔者选用的是sublime text安装gosublime插件进行开发(golang语法高亮提示),安装方式这里就不多提了。
4、Hello GO
配置好开发环境之后,简单的进行一下go语言的开发。在你的gopath下的src目录下,新建一个文件夹(以项目名称命名),然后在sublime中打开该文件夹,新建main.go文件即可以进行编码了。
package main
import (
“fmt”
)
func main() {
fmt.Println(“hello go”);
}
代码编写完成之后,使用command+b打开sublime text终端,使用go build xx(项目名称)对其进行编译,编译通过后将会显示hello go信息。
Casinacho Casino Australia: Bonus, Games and Registration Reviewed Casinacho Casino is an online gambling platform that offers a wide range of games, generous bonuses, and a user-friendly registration process. In this article, we will review the key features of Casinacho Casino Casinacho and provide an overview of what players can expect when they sign up. Bonus Offers One of the main attractions of Casinacho Casino is its generous bonus offers. New players can take advantage of a welcome bonus that includes a cash bonus and free spins on selected slot games. In addition, the casino regularly offers promotions and bonuses to existing players, including reload bonuses, cashback offers, and loyalty rewards. Games Casinacho Casino offers a diverse selection of games to cater to all types of players. The casino features a wide variety of slot games, including classic 3-reel slots, video slots, and progressive jackpot slots. In addition, Casinacho Casino offers a range of table games, including blackjack, roulette, baccarat, and poker. The casino also features live dealer games, where players can interact with real dealers and other players in real-time. Registration Process Signing up for an account at Casinacho Casino is quick and easy. Players simply need to provide their email address, create a username and password, and verify their account through a link sent to their email. Once registered, players can deposit funds into their account using a variety of payment methods, including credit cards, e-wallets, and bank transfers. Security and Fairness Casinacho Casino takes the security and fairness of its games seriously. The casino uses state-of-the-art encryption technology to protect players’ personal and financial information. In addition, all games at Casinacho Casino are regularly tested for fairness by independent auditors to ensure that they are free from manipulation or bias. Customer Support Casinacho Casino offers customer support via live chat, email, and telephone. The casino’s customer support team is available 24/7 to assist players with any questions or issues they may have. In addition, Casinacho Casino features a comprehensive FAQ section that provides answers to common questions about the casino and its games. Overall, Casinacho Casino offers a top-notch online gambling experience for players in Australia. With its generous bonuses, diverse game selection, and user-friendly registration process, Casinacho Casino is a great choice for players looking for a reliable and entertaining online casino.