Make Go a first class language

This commit is contained in:
taoufik07 2023-01-03 01:48:43 +01:00 committed by Anthony Sottile
parent ceb429b253
commit 9afd63948e
4 changed files with 181 additions and 13 deletions

View file

@ -3,7 +3,9 @@ package main
import (
"fmt"
"runtime"
"github.com/BurntSushi/toml"
"os"
)
type Config struct {
@ -11,7 +13,11 @@ type Config struct {
}
func main() {
message := runtime.Version()
if len(os.Args) > 1 {
message = os.Args[1]
}
var conf Config
toml.Decode("What = 'world'\n", &conf)
fmt.Printf("hello %v\n", conf.What)
fmt.Printf("hello %v from %s\n", conf.What, message)
}