summaryrefslogtreecommitdiffstats
path: root/testing/resources/golang_hooks_repo
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 16:53:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 16:53:19 +0000
commit02d5100afa71d1343de4066b812cd4cdc774d812 (patch)
tree6bccae957398fab29aaa226fb0bd65f0c258a36a /testing/resources/golang_hooks_repo
parentAdding upstream version 2.21.0. (diff)
downloadpre-commit-02d5100afa71d1343de4066b812cd4cdc774d812.tar.xz
pre-commit-02d5100afa71d1343de4066b812cd4cdc774d812.zip
Adding upstream version 3.0.2.upstream/3.0.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/resources/golang_hooks_repo')
-rw-r--r--testing/resources/golang_hooks_repo/golang-hello-world/main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/testing/resources/golang_hooks_repo/golang-hello-world/main.go b/testing/resources/golang_hooks_repo/golang-hello-world/main.go
index 1e3c591..1685743 100644
--- a/testing/resources/golang_hooks_repo/golang-hello-world/main.go
+++ b/testing/resources/golang_hooks_repo/golang-hello-world/main.go
@@ -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)
}