diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-04-01 21:33:45 +0200 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-04-01 21:33:45 +0200 |
commit | 516b165421855538e10f41919f1fa72e1fa58912 (patch) | |
tree | 81c3f9a6e6af2d84493b87893ed633a470f7cfe0 /gosrc/main.go | |
parent | 0.0.1.1 (diff) | |
download | smith-516b165421855538e10f41919f1fa72e1fa58912.tar.gz smith-516b165421855538e10f41919f1fa72e1fa58912.tar.bz2 smith-516b165421855538e10f41919f1fa72e1fa58912.tar.xz smith-516b165421855538e10f41919f1fa72e1fa58912.tar.zst smith-516b165421855538e10f41919f1fa72e1fa58912.zip |
hehe
Diffstat (limited to '')
-rw-r--r-- | gosrc/main.go | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gosrc/main.go b/gosrc/main.go new file mode 100644 index 0000000..27cec39 --- /dev/null +++ b/gosrc/main.go @@ -0,0 +1,47 @@ +// SMITH ( // / +// main ( )/ / +// by salade )(/ / +// ________________ ( /) / +// ()__)____________))))) :^} / + +package main + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "log" +) + +// #include "../csrc/smith.h" +// #cgo LDFLAGS: -lsmith -L../ +import "C" + +type Config struct { + Public_key string + Secret_key string + Mirror string +} + +func main() { + fmt.Println("Welcome, traveller, my name is " + Styles.colorGreen + C.GoString(C.mr_smith()) + Styles.colorReset + + "\nI will try to help you get the bag...") + + config_path := "./config.json" + config_content, err := ioutil.ReadFile(config_path) + if err != nil { + log.Fatal("config file not found") + } + + var config Config + err = json.Unmarshal(config_content, &config) + + if err != nil { + log.Fatal("error during marshall() ", err) + } + + fmt.Println("\n" + + Styles.colorBlue + "public_key: " + Styles.colorReset + config.Public_key + "\n" + + Styles.colorBlue + "secret_key: " + Styles.colorReset + config.Secret_key + "\n" + + Styles.colorBlue + "mirror: " + Styles.colorReset + config.Mirror) +} |