mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Make Go a first class language
This commit is contained in:
parent
ceb429b253
commit
9afd63948e
4 changed files with 181 additions and 13 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue