mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-15 21:40:19 -06:00
test golang directly
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
- id: golang-hook
|
||||
name: golang example hook
|
||||
entry: golang-hello-world
|
||||
language: golang
|
||||
files: ''
|
||||
@@ -1,5 +0,0 @@
|
||||
module golang-hello-world
|
||||
|
||||
go 1.18
|
||||
|
||||
require github.com/BurntSushi/toml v1.1.0
|
||||
@@ -1,2 +0,0 @@
|
||||
github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I=
|
||||
github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
@@ -1,23 +0,0 @@
|
||||
package main
|
||||
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"github.com/BurntSushi/toml"
|
||||
"os"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
What string
|
||||
}
|
||||
|
||||
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 from %s\n", conf.What, message)
|
||||
}
|
||||
Reference in New Issue
Block a user