<p>I am in China, and Golang.org was blocked in China.</p>
<p>I wonder if the language specification a downloadable documentation. Anyone can download it for me, and send it to <a href="mailto:aqlysc@qq.com">aqlysc@qq.com</a></p>
<hr/>**评论:**<br/><br/>jeffmetal: <pre><p>Does this work ? <a href="https://golang.google.cn/">https://golang.google.cn/</a></p>
<p>There was a blog posts saying it's accessible in china <a href="https://blog.golang.org/hello-china">https://blog.golang.org/hello-china</a> but no idea if you can actually see the blog post.</p></pre>ChineseCoolGuy: <pre><p>The first link works, and the blog is not accessable.
Many thanks.</p></pre>sh41: <pre><p>It seems silly they've posted that post on the blog which isn't accessible to the target demographic...</p>
<p>The post is short, I'll paste it here for convenience:</p>
<blockquote>
<p>Hello, 中国!<br/>
22 January 2018</p>
<p>We are thrilled to announce that the content on <a href="https://golang.org" rel="nofollow">golang.org</a> is now available in mainland China through the name <a href="https://golang.google.cn" rel="nofollow">https://golang.google.cn</a>. The growing Go developer community in China can now directly access official documentation, technical articles, and binaries.</p>
<p>The Go community in China is bigger than ever. In 2015, Robert Griesemer <a href="https://blog.golang.org/gopherchina" rel="nofollow">visited Shanghai</a> to attend GopherChina, the first Go conference in the country. In the years since, it has become one of the largest Go conferences in the world with over 1200 attendees at their 2017 event. Over the same period, one of the most popular <a href="https://gocn.io/" rel="nofollow">community-built Go forums</a> saw their traffic increase threefold and the number of participants in Go-specific groups on social platforms like WeChat and QQ has grown to over 11,000 people.</p>
<p>Go adoption within China-based companies has also increased, with <a href="https://www.qiniu.com/" rel="nofollow">Qiniu</a>, <a href="http://www.huawei.com/" rel="nofollow">Huawei</a>, <a href="http://www.alibabagroup.com/" rel="nofollow">Alibaba</a>, and countless others using Go heavily in their production stacks.</p>
<p>We’re excited to provide even more resources for Go developers in China to supplement the excellent material already available to them, but this is just the beginning. We’ll be focusing on making Go more accessible to non-English speakers in 2018, so keep watching this space.</p>
<p>By Andrew Bonventre</p>
</blockquote></pre>epiris: <pre><p>You can run a local godoc server, it will have the language spec, pkgs in GOPATH, etc. I have one that runs at startup for just the standard library and one that I run interactively for whatever workspace while I'm developing. </p>
<p>Make sure you have the godoc tool:</p>
<pre><code>$ go get -u -v golang.org/x/tools/cmd/godoc
$ go get -u -v golang.org/x/tools/cmd/... # I suggest getting all the tools.
</code></pre>
<p>Systemd service file:</p>
<pre><code>$ cat /one/svc/godoc-std/service | awk '{print " " $0}'
[Unit]
Description=godoc-std
[Service]
Restart=on-failure
Environment=GOPATH=""
Environment=GOROOT=/ws/lang/go
User=YOURUSERNAME
Group=YOURUSERNAME
RemainAfterExit=yes
ExecStart=/ws/lang/bin/godoc -http=localhost:55555
KillMode=process
[Install]
WantedBy=multi-user.target
</code></pre>
<p>Installing:</p>
<pre><code>$ cat /one/svc/godoc-std/install | awk '{print " " $0}"
#!/bin/bash
cp /one/svc/godoc-std/service /etc/systemd/system/godoc-std.service || { \
printf >&2 "[error] %s must be run as root\n" "${0}"; exit 1
}
chown root:root /etc/systemd/system/godoc-std.service
chmod 444 /etc/systemd/system/godoc-std.service
systemctl enable godoc-std.service
systemctl daemon-reload
</code></pre>
<p>It's now available on localhost:</p>
<pre><code>$ curl -s http://localhost:55555/ref/spec | grep Introduction | awk '{print " " $0}"
<h2 id="Introduction">Introduction</h2>
</code></pre>
<p>Run interactively from the command line for just std lib:</p>
<pre><code>$ GOPATH= godoc -http=:55555 &
$ curl -s http://localhost:55555/ref/spec | grep Introduction | awk '{print " " $0}"
<h2 id="Introduction">Introduction</h2>
</code></pre>
<p>Run interactively from the command line for entire GOPATH.</p>
<pre><code># if $USER == github username.
$ GOPATH= godoc -http=:55557 &
$ curl -s http://localhost:55557/pkg/github.com/${USER}/|grep Package | wc -l
99
</code></pre></pre>sh41: <pre><p>The <code>go get</code> command won't work on <code>golang.org/...</code> import paths for him, since that domain is blocked...</p></pre>ChineseCoolGuy: <pre><p>Thank you for making such a sophisticated reply,which I don't completely understand.I'm still learning go command.Secondly,because Golang.org is blocked and I am not sure if the command with this website as the argument can run on my computer.</p></pre>epiris: <pre><p>Do you have access to github or is that blocked too? You just need the source code for the tools so you can install them. You could also try the go get cmd with the can suffix.</p>
<p>But all those instructions are for is running a site that looks like godoc.org on your localhost. It’s pretty convenient since it works while you’re offline and indexes your local packages so it shows APIs for the versions you’re actually using. Once you have the godoc cmd you can skip everything except and just run: godoc -http=localhost:<pick a port>. </p></pre>ChineseCoolGuy: <pre><p>Trying to understand your post.</p></pre>MatthiasLuft: <pre><p>Why on earth is this downvoted?</p></pre>pinpinbo: <pre><p>Think of this as an opportunity to learn about VPN and what it can do for you.</p></pre>jamra06: <pre><p>China can block VPNs</p></pre>ChineseCoolGuy: <pre><p>I tried a lot of free ones, Now they were all blocked by the Chinese government. I see no reason for buying a paid VPN, To view Facebook or Twitter?,there's few Chinese people there.</p></pre>pinpinbo: <pre><p>Oh damn, I had no idea VPN are all blocked there. Sorry.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传