programming language/Go
[Go] go-tour _ welcome
moaoh
2021. 9. 21. 20:17
ํด๋น๊ธ์ ์๋ ๋ด์ฉ์ ๋ฐํ์ผ๋ก ๊ณต๋ถํ ๋ด์ฉ๋ค์ ์ ๋ฆฌํ ๊ธ ์ ๋๋ค.
Go๋ฅผ ํฅํ ์ฌํ
go-tour-ko.appspot.com
Hello
package main
import "fmt"
func main() {
fmt.Println("Hello")
}
go์ ๊ฐ์ฅ ๊ธฐ๋ณธ์ ์ธ "hello" ์ถ๋ ฅํ๊ธฐ
์ด๋ป๊ฒ ์ฌ์ฉ์ ํ๋๊ฑด์ง ํ๋ฒ ํด๋ด๋ผ ๋ผ๋ ๋ด์ฉ
time
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("Welcome to the playground!")
fmt.Println("The time is", time.Now())
}
time ํจํค์ง ์๊ฐ์ ํํํ๊ธฐ ์ํ ํจ์๋ค์ ๊ฐ์ง๊ณ ์์
time.Now() ํ์ฌ ์๊ฐ์ ๊ฐ์ ธ์จ๋ค.
ํ์๊ฐ ํ์ฌ ํ๋ก๊ทธ๋จ์ ๋๋ฆฌ๊ณ ์๋ ์๊ฐ์ ๋ณด๋ฅผ ๊ฐ์ ธ์ฌ ์ ์๋ค.