笔者使用的是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 Review: Games and Banking for Canadian Players. Casinacho Casino is a popular online gambling platform that offers a wide variety of games and banking options for Canadian players. In this Casinacho Casino casino-casinacho.ca review, we will take a closer look at the games available on the site and the different banking methods that Canadian players can use to fund their accounts. Casinacho Casino offers a wide range of games for players to enjoy, including slots, table games, and live dealer games. The site features games from top software providers such as Microgaming, NetEnt, and Evolution Gaming, ensuring that players have access to high-quality games with smooth gameplay and impressive graphics. One of the most popular games on Casinacho Casino is slots, with a wide selection of titles to choose from. Players can enjoy classic three-reel slots, modern video slots, and progressive jackpot slots that offer the chance to win big prizes. Some of the most popular slots on the site include Mega Moolah, Gonzo’s Quest, and Starburst. In addition to slots, Casinacho Casino also offers a variety of table games for players to enjoy. This includes classics such as blackjack, roulette, and baccarat, as well as less common games like Sic Bo and Pai Gow Poker. The site also features live dealer games, where players can interact with real dealers and other players in real-time, creating a more immersive and social gaming experience. When it comes to banking options, Casinacho Casino offers a variety of methods for Canadian players to deposit and withdraw funds from their accounts. Players can use credit and debit cards, e-wallets, bank transfers, and prepaid cards to make transactions on the site. The site also supports popular payment methods such as Interac, Instadebit, and iDebit, making it easy for Canadian players to manage their funds. Casinacho Casino takes the security of its players’ information and funds seriously, using encryption technology to protect sensitive data and ensuring that all transactions are processed securely. The site also has a dedicated customer support team available 24/7 to assist players with any issues or questions they may have. Overall, Casinacho Casino is a top choice for Canadian players looking for a comprehensive online gambling experience. With a wide selection of games, secure banking options, and reliable customer support, the site offers everything players need to enjoy a safe and enjoyable gaming experience. Whether you’re a fan of slots, table games, or live dealer games, Casinacho Casino has something for everyone.