Git Product home page Git Product logo

tour's Introduction

Golang官方中文教程修改版

解决跨域/Docker下载部署

最新修改,可以采用docker部署(并解决websocket跨域问题).

最简单的部署方案:

# 拉镜像
docker pull hunterhug/gotourzh

# 前台运行
docker run -it -p 9999:9999 hunterhug/gotourzh

# 后台运行(类似nohup)
docker run -d -p 9999:9999 hunterhug/gotourzh

打开http://127.0.0.1:9999即可!

增加依赖/源码安装部署

因为依旧因为各种墙, 所以修改了gotour将所有依赖一并打包进vendor上传, 不再为墙困扰.现在只需要在路径$GOPATH/github.com/Go-zh下克隆这个仓库, 移动vendorGOPATH, 然后编译安装二进制执行即可:

$ mkdir -p $GOPATH/src/github.com/Go-zh
$ cd $GOPATH/src/github.com/Go-zh && git clone 这个仓库
$ cd tour && cp -r vendor/* $GOPATH/src
$ cd gotour && go build && go install
$ ./gotour

运行指定地址:

gotour -http=0.0.0.0:9999

如果想后台运行:

nohup gotour -http=0.0.0.0:9999 &

打开http://127.0.0.1:9999即可!

Nginx配置远程访问

如果需要远程访问, 请配置Nginx反向代理, 配置如下:

server{
	listen 80;
	server_name go.lenggirl.com;
	charset utf-8;
	access_log /root/gotour.log;
	location / {
  	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  	proxy_set_header Host $http_host;
  	proxy_redirect off;
  	proxy_pass http://127.0.0.1:9999;

	proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
	}	
}

打开: go.lenggirl.com


《Go 语言之旅》是官方 Go Tour 的中文翻译版。

在本地安装教程此教程(英文版)最容易的方式,就是安装一份Go 的二进制发行版 并执行:

$ go tool tour

要从源码安装本教程,首先请 设置一个工作空间 并执行:

$ go get -u github.com/Go-zh/tour/gotour

这会在你工作空间的 bin 目录中创建一个 gotour 可执行文件。

(如果安装过程中出现 packageimport字样的错误提示,那么说明依赖库的导入路径又挂了。这时请猛戳 @OlingCat 并督促其解决= =||)

翻译贡献者名单:

@qiansen138	#224
@tiant16	#206
@ybi		#198
@anamewin	#191

除特别声明外,go-tour 源码文件均采用BSD风格的授权许可分发,许可内容见 LICENSE 文件。

Contributions should follow the same procedure as for the Go project: 贡献方式应与 Go 项目遵循相同的流程: http://go-zh.org/doc/contribute.html

tour's People

Contributors

abbot avatar adg avatar alexbrainman avatar andrewaustin avatar broady avatar campoy avatar chai2010 avatar drjosh9000 avatar dupoxy avatar faxriddin avatar hunterhug avatar kortschak avatar kylelemons avatar kytrinyx avatar mak73kur avatar mikespook avatar minux avatar nickpresta avatar nikolas avatar olingcat avatar rakyll avatar robphoenix avatar robpike avatar sajmani avatar shulhan avatar smugcloud avatar trung avatar tux21b avatar ybin avatar zorion avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.