From 3b752dc02e8ac2048c3dc6efa37145c679502c84 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Mon, 10 Jul 2017 19:33:56 +0100 Subject: added global configuration system (config.go) --- scorsh.go | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'scorsh.go') diff --git a/scorsh.go b/scorsh.go index a5adbb8..08fc962 100644 --- a/scorsh.go +++ b/scorsh.go @@ -2,9 +2,7 @@ package main import ( "errors" - "golang.org/x/crypto/openpgp" "log" - "os" "flag" ) @@ -57,46 +55,13 @@ func SCORSHErr(err int) error { } -func SCORSHWorker(keyring string, c_msg chan SCORSHmsg, c_status chan int) { - - // read the worker configuration file - - // Open the keyring file - f, err := os.Open(keyring) - defer f.Close() - - if err != nil { - log.Printf("[worker] cannot open file %s\n", keyring) - c_status <- SCORSH_ERR_NO_FILE - return - } - - // load the keyring - kr, err := openpgp.ReadArmoredKeyRing(f) - - if err != nil { - log.Printf("[worker] cannot open keyring %s\n", keyring) - log.Printf("%s\n", err) - c_status <- SCORSH_ERR_KEYRING - return - } - - // wait for messages from the c_msg channel - - msg := <-c_msg - - // process message - ret := walk_commits(msg, kr) - - c_status <- ret - -} func main() { flag.Parse() - - + cfg := ReadConfig(*conf_file) + + log.Printf("%s\n", cfg) } -- cgit v1.2.3