test golang directly

This commit is contained in:
marsha
2023-02-06 12:24:30 -06:00
parent f7df13f3d8
commit 6804100701
7 changed files with 117 additions and 161 deletions

View File

@@ -1,5 +0,0 @@
- id: golang-hook
name: golang example hook
entry: golang-hello-world
language: golang
files: ''

View File

@@ -1,5 +0,0 @@
module golang-hello-world
go 1.18
require github.com/BurntSushi/toml v1.1.0

View File

@@ -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=

View File

@@ -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)
}