Go Go Go
版權宣告:本文為博主原創文章,轉載時請務必註明本文地址, 禁止用於任何商業用途, 否則會用法律維權。https://blog.csdn.net/stpeace/article/details/78278453
第一次玩go, 準備在linux上搭建個環境, 一起似乎都準備好了, 然後出現:
xxxxxx:~> go run me.go FATAL: kernel too old go build command-line-arguments: signal: segmentation fault
暈, 居然嫌棄我linux版本太舊, 我暫時不想升級linux, 也不想再Windows上玩go, 那還是用線上的方法搞起吧, 看我的第一個go程式:
package main import "fmt" func main(){ fmt.Println("hello world") fmt.Println("This is my first Go code") }
結果:
hello world
This is my first Go code
上面的程式看著不太爽, 沒有分號, 這就是go的脾氣, 另外, 我看著那個括號也很不舒服, 於是改為:
package main import "fmt" func main() { fmt.Println("hello world") fmt.Println("This is my first Go code") }
程式碼報錯, 這就是go的脾氣, 算是瞭解了。 你牛!