From 87ea4cc5e5d0f2ce30a59c48fd5ef009f7af7530 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Fri, 6 Aug 2021 14:27:42 +0100 Subject: [PATCH] Don't print config on start, add a couple comments --- config/config.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/config/config.go b/config/config.go index e446797..2f49971 100644 --- a/config/config.go +++ b/config/config.go @@ -1,10 +1,6 @@ package config -import ( - "encoding/json" - "fmt" -) - +// The struct that represents the config.json file type Config struct { ListenAddress string Services map[string]struct { @@ -16,14 +12,12 @@ type Config struct { } } +// Check that all required fields are filled in func (c Config) Validate() error { if c.ListenAddress == "" { return requiredFieldError{"ListenAddress", ""} } - jsonbytes, _ := json.MarshalIndent(c, "", " ") - fmt.Println(string(jsonbytes)) - for serviceName, service := range c.Services { if service.Script.Program == "" { return requiredFieldError{"Script.Program", serviceName}