發表文章

目前顯示的是 2月, 2018的文章

[Golang] for

Method 1:  //add from 0 to 4 func main(){ sum := 0 for i := 0 ; i < 5 ; i++ { sum += i } fmt.Print(sum) } Method 2: // stop iterating when the variable is over 1000 func main(){ sum := 1 for sum < 1000 { sum += sum } fmt.Print(sum) }

[Golang] How to run .go file in Windows cmd

How to run .go file in Windows cmd (1) direct to the file folder Ex.: cd C:\Go\src\temp (2) send command... go run temp.go