Golang 第5節 第一個 Go 程序

本節咱們來學習寫一個最簡單的 Go 程序: 打印 Hello Go.git

第一個Go程序, 只要跟着作, 留下個印象就能夠.

Goland 建立一個 hello_go.go 文件(後綴爲 .go ). 文件內容是學習

package main

import "fmt"

func main() {
	fmt.Println("Hello Go")
}

Goland 中使用快捷鍵 Ctrl + Shift + F10 運行程序, 結果以下:code

image

完美! 如今您已經學會怎樣運行了一個Go程序了.blog

李培冠博客

lpgit.comget

相關文章
相關標籤/搜索