mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add first class support for golang hooks
This commit is contained in:
parent
209339582c
commit
068c18d38a
11 changed files with 151 additions and 7 deletions
|
|
@ -0,0 +1,5 @@
|
|||
- id: golang-hook
|
||||
name: golang example hook
|
||||
entry: golang-hello-world
|
||||
language: golang
|
||||
files: ''
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package main
|
||||
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/BurntSushi/toml"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
What string
|
||||
}
|
||||
|
||||
func main() {
|
||||
var conf Config
|
||||
toml.Decode("What = 'world'\n", &conf)
|
||||
fmt.Printf("hello %v\n", conf.What)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue