• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

Go语言的注释方法同样采用以下两种

行注释  //

块注释  /*  */

Go语言的代码风格

您可以使用gofmt命令一键格式化。

1 //go语言一个文件必须属于一个包,下面的语句表示当前文件所属的主包。

2包主

4 //import关键字是指在引入fmt包时,可以直接使用fmt包中的函数。

5 //包名需要以字符串的形式引入

6进口' fmt '

8 //当前文件定义了主函数:main function

9 func main(){

10英尺。Println('Hello World!')

11 }

k2zx1bqdiqz3149.png

Gofmt filename.go直接返回格式化代码。

Gofmt -w filename.go格式化文件。

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now