当前位置:网站首页>[golang] go into go language lesson 1 Hello World

[golang] go into go language lesson 1 Hello World

2021-08-08 02:36:51 I'm Xiaobai

【Golang】️ Walk into Go Language ️ The first lesson Hello World

summary

Golang Is a new cross platform programming language . Today, Xiaobai will take you hand in hand into Golang The world of . ( The first 1 course )

 Insert picture description here

Go Language structure

Before we start to learn Go The basic building blocks of programming language , Let's take a look Go The program structure of language .

 Insert picture description here
Go The basic components of language are as follows :

  • Package declaration
  • Introduction package
  • function
  • Variable
  • sentence & expression
  • notes

New projects

 Insert picture description here
 Insert picture description here

Hello World

Code :

package main  //  It belongs to executable file 

import "fmt"  //  Belong to fmt The module implements input and output 

func main(){
	/*
	func:  function 
	main:  Main executive function 
	():  Parameters 
	{}:  The body of the function 
	 */
	
	//  Debug output "Hello World"
	fmt.Println("Hello World")
}

Output results :

 Insert picture description here

版权声明
本文为[I'm Xiaobai]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/08/20210808023504358v.html

随机推荐