{"rsdb":{"rid":"241364","subhead":"","postdate":"0","aid":"166194","fid":"78","uid":"1","topic":"1","content":"
Go \u8bed\u8a00\u652f\u6301\u4ee5\u4e0b\u7cfb\u7edf\uff1a<\/p> \n
\u3000\u3000\u5b89\u88c5\u5305\u4e0b\u8f7d\u5730\u5740\u4e3a\uff1ahttps:\/\/golang<\/a>.org\/dl\/<\/a>\u3002<\/p> \n \u3000\u3000Windows\u4e0b\u76f4\u63a5\u4e0b\u8f7d\u5bf9\u5e94\u7684\u7248\u672c\u5b89\u88c5\u5c31\u53ef\u4ee5\u4e86\u3002<\/p> \n \u3000\u3000\u65b0\u5efahello.go\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p> \n <\/p> \n \u3000\u3000\u547d\u4ee4\u884c\u8fd0\u884c go run hello.go<\/span><\/span><\/span><\/p> \n \u3000\u3000\u6ce8\u610f\uff1apackage\u6307\u5305\u540d\uff0c\u548c\u6240\u5c5e\u6587\u4ef6\u5939\u65e0\u5173\uff0c\u5165\u53e3\u7a0b\u5e8f\u7684package\u5fc5\u987b\u662fmain\u3002import\u5f15\u5165\u5305\u3002func \u5b9a\u4e49\u51fd\u6570\uff0c\u5165\u53e3\u7a0b\u5e8f\u7684\u51fd\u6570\u540d\u5fc5\u987b\u662fmain\u3002<\/span><\/span><\/span><\/p> \n \u3000\u3000LiteIDE\u662f\u4e00\u6b3e\u5f00\u6e90\u3001\u8de8\u5e73\u53f0\u7684\u8f7b\u91cf\u7ea7Go\u8bed\u8a00\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3002\u9879\u76ee\u5730\u5740\uff1ahttps:\/\/github.com\/visualfc\/liteide<\/span><\/span><\/span><\/p> \n \u3000\u3000JetBrains\u5f00\u53d1\u7684JetBrains GoLand\uff0chttps:\/\/www.jetbrains.com\/go\/download\/<\/span><\/span><\/span><\/p> \n <\/p> \n \u3000\u3000<\/span><\/span><\/span><\/p> \n Go \u8bed\u8a00\u7684\u57fa\u7840\u7ec4\u6210\u6709\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206\uff1a<\/p> \n <\/p> \n \u3000\u3000\u63a5\u4e0b\u6765\u8ba9\u6211\u4eec\u6765\u770b\u4e0b\u7b80\u5355\u7684\u4ee3\u7801\uff0c\u8be5\u4ee3\u7801\u8f93\u51fa\u4e86"Hello World!":<\/p> \n <\/p> \n \u3000\u30001\u3001\u7b2c\u4e00\u884c\u4ee3\u7801 package main<\/em> \u5b9a\u4e49\u4e86\u5305\u540d\u3002\u4f60\u5fc5\u987b\u5728\u6e90\u6587\u4ef6\u4e2d\u975e\u6ce8\u91ca\u7684\u7b2c\u4e00\u884c\u6307\u660e\u8fd9\u4e2a\u6587\u4ef6\u5c5e\u4e8e\u54ea\u4e2a\u5305\uff0c\u5982\uff1apackage main\u3002package main\u8868\u793a\u4e00\u4e2a\u53ef\u72ec\u7acb\u6267\u884c\u7684\u7a0b\u5e8f\uff0c\u6bcf\u4e2a Go \u5e94\u7528\u7a0b\u5e8f\u90fd\u5305\u542b\u4e00\u4e2a\u540d\u4e3a main \u7684\u5305\u3002\u3000<\/p> \n \u3000\u30002\u3001\u4e0b\u4e00\u884c import "fmt"<\/em> \u544a\u8bc9 Go \u7f16\u8bd1\u5668\u8fd9\u4e2a\u7a0b\u5e8f\u9700\u8981\u4f7f\u7528 fmt \u5305\uff08\u7684\u51fd\u6570\uff0c\u6216\u5176\u4ed6\u5143\u7d20\uff09\uff0cfmt \u5305\u5b9e\u73b0\u4e86\u683c\u5f0f\u5316 IO\uff08\u8f93\u5165\/\u8f93\u51fa\uff09\u7684\u51fd\u6570\u3002<\/p> \n \u3000\u30003\u3001\u4e0b\u4e00\u884c func main()<\/em> \u662f\u7a0b\u5e8f\u5f00\u59cb\u6267\u884c\u7684\u51fd\u6570\u3002main \u51fd\u6570\u662f\u6bcf\u4e00\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f\u6240\u5fc5\u987b\u5305\u542b\u7684\uff0c\u4e00\u822c\u6765\u8bf4\u90fd\u662f\u5728\u542f\u52a8\u540e\u7b2c\u4e00\u4e2a\u6267\u884c\u7684\u51fd\u6570\uff08\u5982\u679c\u6709 init() \u51fd\u6570\u5219\u4f1a\u5148\u6267\u884c\u8be5\u51fd\u6570\uff09\u3002<\/p> \n \u3000\u30004\u3001\u4e0b\u4e00\u884c \/*...*\/ \u662f\u6ce8\u91ca\uff0c\u5728\u7a0b\u5e8f\u6267\u884c\u65f6\u5c06\u88ab\u5ffd\u7565\u3002\u5355\u884c\u6ce8\u91ca\u662f\u6700\u5e38\u89c1\u7684\u6ce8\u91ca\u5f62\u5f0f\uff0c\u4f60\u53ef\u4ee5\u5728\u4efb\u4f55\u5730\u65b9\u4f7f\u7528\u4ee5 \/\/ \u5f00\u5934\u7684\u5355\u884c\u6ce8\u91ca\u3002\u591a\u884c\u6ce8\u91ca\u4e5f\u53eb\u5757\u6ce8\u91ca\uff0c\u5747\u5df2\u4ee5 \/* \u5f00\u5934\uff0c\u5e76\u4ee5 *\/ \u7ed3\u5c3e\uff0c\u4e14\u4e0d\u53ef\u4ee5\u5d4c\u5957\u4f7f\u7528\uff0c\u591a\u884c\u6ce8\u91ca\u4e00\u822c\u7528\u4e8e\u5305\u7684\u6587\u6863\u63cf\u8ff0\u6216\u6ce8\u91ca\u6210\u5757\u7684\u4ee3\u7801\u7247\u6bb5\u3002<\/p> \n \u3000\u30005\u3001\u4e0b\u4e00\u884c fmt.Println(...)<\/em> \u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u8f93\u51fa\u5230\u63a7\u5236\u53f0\uff0c\u5e76\u5728\u6700\u540e\u81ea\u52a8\u589e\u52a0\u6362\u884c\u5b57\u7b26 \\n\u3002 <\/p> \n <\/p> \n \u3000\u3000\u5728 Go \u7a0b\u5e8f\u4e2d\uff0c\u4e00\u884c\u4ee3\u8868\u4e00\u4e2a\u8bed\u53e5\u7ed3\u675f\u3002\u5206\u53f7(;)\u662f\u53ef\u9009\u7684\uff0c\u5982\u679c\u6253\u7b97\u5c06\u591a\u4e2a\u8bed\u53e5\u5199\u5728\u540c\u4e00\u884c\uff0c\u5b83\u4eec\u5219\u5fc5\u987b\u4f7f\u7528 ; \u5206\u5272\uff0c\u4f46\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u4e0d\u8981\u4f7f\u7528\u8fd9\u79cd\u505a\u6cd5\u3002<\/p> \n \u3000\u3000\u6ce8\u91ca\u4e0d\u4f1a\u88ab\u7f16\u8bd1\uff0c\u6bcf\u4e00\u4e2a\u5305\u5e94\u8be5\u6709\u76f8\u5173\u6ce8\u91ca\u3002go\u7684\u6ce8\u91ca\u548cc\uff0cjava<\/a>\u4e00\u6837\uff0c\u6709\u5355\u884c\u6ce8\u91ca\/\/\uff0c\u548c\u591a\u884c\u6ce8\u91ca \/* ... *\/<\/p> \n \/\/ \u5355\u884c\u6ce8\u91ca<\/span><\/p> \n \/*<\/span><\/span><\/span><\/p> \n \u6211\u662f\u591a\u884c\u6ce8\u91ca<\/span><\/span><\/span><\/p> \n *\/<\/span><\/span><\/span><\/p> \n \u3000\u3000\u6807\u8bc6\u7b26\u7528\u6765\u547d\u540d\u53d8\u91cf\u3001\u7c7b\u578b\u7b49\u7a0b\u5e8f\u5b9e\u4f53\u3002\u4e00\u4e2a\u6807\u8bc6\u7b26\u5b9e\u9645\u4e0a\u5c31\u662f\u4e00\u4e2a\u6216\u662f\u591a\u4e2a\u5b57\u6bcd(A~Z\u548ca~z)\u6570\u5b57(0~9)\u3001\u4e0b\u5212\u7ebf_\u7ec4\u6210\u7684\u5e8f\u5217\uff0c\u4f46\u662f\u7b2c\u4e00\u4e2a\u5b57\u7b26\u5fc5\u987b\u662f\u5b57\u6bcd\u6216\u4e0b\u5212\u7ebf\u800c\u4e0d\u80fd\u662f\u6570\u5b57\u3002<\/p> \n \u3000\u3000\u4ee5\u4e0b\u662f\u6709\u6548\u7684\u6807\u8bc6\u7b26\uff1a<\/p> \n \u3000\u3000\u4ee5\u4e0b\u662f\u65e0\u6548\u7684\u6807\u8bc6\u7b26\uff1a<\/p> \n \u3000\u3000\u4e0b\u9762\u5217\u4e3e\u4e86 Go \u4ee3\u7801\u4e2d\u4f1a\u4f7f\u7528\u5230\u7684 25 \u4e2a\u5173\u952e\u5b57\u6216\u4fdd\u7559\u5b57\uff1a<\/p> \n \u7a0b\u5e8f\u4e2d\u53ef\u80fd\u4f1a\u4f7f\u7528\u5230\u8fd9\u4e9b\u6807\u70b9\u7b26\u53f7\uff1a\u70b9\u53f7. \u9017\u53f7, \u5206\u53f7; \u5192\u53f7: \u4e09\u4e2a\u70b9\u53f7\u2026<\/p> \n \u3000\u3000<\/span><\/span><\/span><\/p> \n \u5728 Go \u7f16\u7a0b\u8bed\u8a00\u4e2d\uff0c\u6570\u636e\u7c7b\u578b\u7528\u4e8e\u58f0\u660e\u51fd\u6570\u548c\u53d8\u91cf\u3002<\/p> \n <\/p> \n \u3000\u3000\u5e03\u5c14\u578b\u7684\u503c\u53ea\u53ef\u4ee5\u662f\u5e38\u91cf true \u6216\u8005 false\u3002<\/p> \n \u3000\u3000\u6574\u578b int \u548c\u6d6e\u70b9\u578b float\uff0cGo \u8bed\u8a00\u652f\u6301\u6574\u578b\u548c\u6d6e\u70b9\u578b\u6570\u5b57\uff0c\u5e76\u4e14\u539f\u751f\u652f\u6301\u590d\u6570\uff0c\u5176\u4e2d\u4f4d\u7684\u8fd0\u7b97\u91c7\u7528\u8865\u7801\u3002<\/p> \n \u3000\u3000\u6574\u578b\u5206\u6709\u7b26\u53f7\u548c\u65e0\u7b26\u53f7\uff1a<\/p> \n \u3000\u3000uint8\uff0cuint16\uff0cuint32\uff0cuint64\uff0cint8\uff0cint16\uff0cint32\uff0cint64\u5206\u522b\u8868\u793a\u65e0\u7b26\u53f7\u548c\u6709\u7b26\u53f7\u76848\u4f4d\uff0c16\u4f4d\uff0c32\u4f4d\uff0c64\u4f4d\u6574\u578b<\/p> \n \u3000\u3000\u6d6e\u70b9\u578b\uff1a<\/p> \n \u3000\u3000float32 32\u4f4d\u6d6e\u70b9\u6570\uff0cfloat64\u4f4d\u6d6e\u70b9\u6570\u3002complex64 32\u4f4d\u5b9e\u6570\u548c\u865a\u6570\uff0ccomplex128 64\u4f4d\u5b9e\u6570\u548c\u865a\u6570<\/p> \n \u3000\u3000\u5176\u4ed6\u6570\u5b57\u7c7b\u578b\uff1a\u3000\u3000<\/em><\/p> \n byte\u3000\u3000\u7c7b\u4f3c uint8 \u5b57\u7b26\u4e32\u5c31\u662f\u4e00\u4e32\u56fa\u5b9a\u957f\u5ea6\u7684\u5b57\u7b26\u8fde\u63a5\u8d77\u6765\u7684\u5b57\u7b26\u5e8f\u5217\u3002Go\u7684\u5b57\u7b26\u4e32\u662f\u7531\u5355\u4e2a\u5b57\u8282\u8fde\u63a5\u8d77\u6765\u7684\u3002Go\u8bed\u8a00\u7684\u5b57\u7b26\u4e32\u7684\u5b57\u8282\u4f7f\u7528UTF-8\u7f16\u7801\u6807\u8bc6Unicode\u6587\u672c\u3002<\/p> \n \u5305\u62ec\uff1aHello World<\/h2> \n
package main\n\nimport "fmt"\n\nfunc main() {\n fmt.Println("Hello, World!")\n}\u3000\u3000<\/pre> \n <\/div> \n
IDE<\/span><\/span><\/span><\/h2> \n
go\u8bed\u8a00\u7ed3\u6784<\/span><\/span><\/span><\/h2> \n
\n
\n
package main\n\nimport "fmt"\n\nfunc main() {\n \/* \u8fd9\u662f\u6211\u7684\u7b2c\u4e00\u4e2a\u7b80\u5355\u7684\u7a0b\u5e8f *\/\n fmt.Println("Hello, World!")\n}<\/pre> \n <\/div> \n
go\u8bed\u8a00\u57fa\u7840\u8bed\u6cd5<\/h2> \n
\u3000\u3000\u884c\u5206\u9694\u7b26<\/h3> \n
\u3000\u3000\u6ce8\u91ca<\/h3> \n
\u3000\u3000\u6807\u8bc6\u7b26<\/h3> \n
mahesh kumar abc move_name a_123\nmyname50 _temp j a23b9 retVal<\/span><\/pre> \n
\n
\n
\n \n
\n break<\/td> \n default<\/td> \n func<\/td> \n interface<\/td> \n select<\/td> \n <\/tr> \n \n case<\/td> \n defer<\/td> \n go<\/td> \n map<\/td> \n struct<\/td> \n <\/tr> \n \n chan<\/td> \n else<\/td> \n goto<\/td> \n package<\/td> \n switch<\/td> \n <\/tr> \n \n const<\/td> \n fallthrough<\/td> \n if<\/td> \n range<\/td> \n type<\/td> \n <\/tr> \n \n continue<\/td> \n for<\/td> \n import<\/td> \n return<\/td> \n var<\/td> \n <\/tr> \n <\/tbody> \n <\/table> \n
\u3000\u3000\u9664\u4e86\u4ee5\u4e0a\u4ecb\u7ecd\u7684\u8fd9\u4e9b\u5173\u952e\u5b57\uff0cGo \u8bed\u8a00\u8fd8\u6709 36 \u4e2a\u9884\u5b9a\u4e49\u6807\u8bc6\u7b26\uff1a<\/p> \n \n \n
\n append<\/td> \n bool<\/td> \n byte<\/td> \n cap<\/td> \n close<\/td> \n complex<\/td> \n complex64<\/td> \n complex128<\/td> \n uint16<\/td> \n <\/tr> \n \n copy<\/td> \n false<\/td> \n float32<\/td> \n float64<\/td> \n imag<\/td> \n int<\/td> \n int8<\/td> \n int16<\/td> \n uint32<\/td> \n <\/tr> \n \n int32<\/td> \n int64<\/td> \n iota<\/td> \n len<\/td> \n make<\/td> \n new<\/td> \n nil<\/td> \n panic<\/td> \n uint64<\/td> \n <\/tr> \n \n print<\/td> \n println<\/td> \n real<\/td> \n recover<\/td> \n string<\/td> \n true<\/td> \n uint<\/td> \n uint8<\/td> \n uintptr<\/td> \n <\/tr> \n <\/tbody> \n <\/table> \n
\u7a0b\u5e8f\u4e2d\u53ef\u80fd\u4f1a\u4f7f\u7528\u5230\u8fd9\u4e9b\u5206\u9694\u7b26\uff1a\u62ec\u53f7 ()\uff0c\u4e2d\u62ec\u53f7 [] \u548c\u5927\u62ec\u53f7 {}\u3002\u7a0b\u5e8f\u4e00\u822c\u7531\u5173\u952e\u5b57\u3001\u5e38\u91cf\u3001\u53d8\u91cf\u3001\u8fd0\u7b97\u7b26\u3001\u7c7b\u578b\u548c\u51fd\u6570\u7ec4\u6210\u3002<\/p> \n Go \u8bed\u8a00\u6570\u636e\u7c7b\u578b<\/h2> \n
\u3000\u30001\u3001\u5e03\u5c14\u578b<\/h3> \n
2\u3001\u6570\u5b57\u7c7b\u578b<\/h3> \n
rune\u3000\u3000\u7c7b\u4f3c int32
uint\u3000\u300032 \u6216 64 \u4f4d
int\u3000\u3000\u4e0e uint \u4e00\u6837\u5927\u5c0f
uintptr\u3000\u3000\u65e0\u7b26\u53f7\u6574\u578b\uff0c\u7528\u4e8e\u5b58\u653e\u4e00\u4e2a\u6307\u9488<\/p> \n 3\u3001\u5b57\u7b26\u4e32\u7c7b\u578b:<\/h3> \n
4\u3001\u6d3e\u751f\u7c7b\u578b\uff1a<\/h3> \n
(a) \u6307\u9488\u7c7b\u578b\uff08Pointer\uff09
(b) \u6570\u7ec4\u7c7b\u578b
(c) \u7ed3\u6784\u5316\u7c7b\u578b(struct)
(d) Channel \u7c7b\u578b
(e) \u51fd\u6570\u7c7b\u578b
(f) \u5207\u7247\u7c7b\u578b
(g) \u63a5\u53e3\u7c7b\u578b\uff08interface\uff09
(h) Map \u7c7b\u578b<\/p> \n <\/h2>\n<\/div>","orderid":"0","title":"go\u8bed\u8a00\u5165\u95e8(\u4e00)","smalltitle":"","mid":"0","fname":"GO","special_id":"0","bak_id":"0","info":"0","hits":"308","pages":"1","comments":"0","posttime":"2017-11-20 08:34:54","list":"1511138094","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"\u8bed\u8a00<\/A> \u5165\u95e8<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"183.15.83.253","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"go\u8bed\u8a00\u5165\u95e8(\u4e00)","lastview":"1713546444","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}