<p>I heard Go was open source, but I can't seem to find it's source code. All I seem to find is the source code for it's standard library, nothing with a main function or anything. I'm pretty novice so sorry if this is a really cringey question. As in the source code that actually does the text processing</p>
<hr/>**评论:**<br/><br/>chocolateAltoids: <pre><blockquote>
<p>I heard Go was open source</p>
</blockquote>
<p>It is.</p>
<blockquote>
<p>but I can't seem to find it's source code.</p>
</blockquote>
<p><a href="https://github.com/golang/go">Github</a></p>
<blockquote>
<p>All I seem to find is the source code for it's standard library, nothing with a main function or anything.</p>
</blockquote>
<p>So when you download and install Go onto your local computer you install some pieces of code (packages like 'fmt', 'bufio', 'crypto', etc.) that you can use within the Go program that you are creating. There is no 'main' function to speak of because you are dealing with code that cannot execute by itself it needs to be used in something.</p>
<p>Now the tools like "go", "gofmt", "cgo", etc. do have a main function. Those tools can be found <a href="https://github.com/golang/go/tree/master/src/cmd">here</a>. It's the same github link as before in the /cmd directory (it's because the tools are commands :P)</p>
<p>However, there should be little reason for you to poke around the source for the tools. Rather, based on your self describe 'novice' level with go, I'd recommend becoming more familiar with the standard library (the packages I spoke about before) and learn how to appropriately leverage them in whatever you are wanting to do.</p>
<blockquote>
<p>I'm pretty novice so sorry if this is a really cringey question</p>
</blockquote>
<p>If you are looking to familiarize yourself with Go, I'd highly recommend <a href="https://gobyexample.com/">Go By Example</a> until you get down to the section titled "Variadic Functions". Then I'd try to start solving 'small problems' with Go ( <a href="/r/dailprogrammer">/r/dailprogrammer</a> is a good little list of programming problems ).</p>
<p>We were all noobs at one time or another :P Overall, hopefully that clarified some things for you.</p></pre>sabi0: <pre><p>Thanks man you're really helpful</p></pre>truehum4ndesign: <pre><p>What do you mean? Everything is there: <a href="https://github.com/golang" rel="nofollow">https://github.com/golang</a></p></pre>Thomasdezeeuw: <pre><p><a href="https://github.com/golang/go/blob/58ad0176ca280c07a966249a3208f707ee0b1989/src/cmd/go/main.go#L69" rel="nofollow">https://github.com/golang/go/blob/58ad0176ca280c07a966249a3208f707ee0b1989/src/cmd/go/main.go#L69</a> is the main function for the "go" binary.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传