Last active
October 16, 2016 05:23
-
-
Save fk2000/70f06cf8fbe7ec27f8a2d880ff1ff4dc to your computer and use it in GitHub Desktop.
GolangでHello World! ref: http://qiita.com/fk_2000/items/d691c9e1ffff170359db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Println("Hello World!") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls -ltr | |
total 3160 | |
-rw-r--r-- 1 val staff 76 Oct 7 10:47 hello.go | |
-rwxr-xr-x 1 val staff 1607616 Oct 7 10:47 hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./hello | |
Hello World! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run hello.go | |
Hello World! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
fmt.Println("The current time is", time.Now()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run time.go | |
The current time is 2016-10-07 11:00:11.027383849 +0900 JST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ date | |
Fri Oct 7 11:00:19 JST 2016 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment