mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
test golang directly
This commit is contained in:
parent
f7df13f3d8
commit
6804100701
7 changed files with 117 additions and 161 deletions
|
|
@ -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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue