Jelajahi Sumber

netclient: pass by value -> reference

Updates various function arguments to accept config.ClientConfig
as a reference to avoid deep copying the struct.

Signed-off-by: John Sahhar <[email protected]>
John Sahhar 3 tahun lalu
induk
melakukan
d9490e5885
1 mengubah file dengan 1 tambahan dan 3 penghapusan
  1. 1 3
      config/config.go

+ 1 - 3
config/config.go

@@ -6,7 +6,6 @@ package config
 
 import (
 	"fmt"
-	"log"
 	"os"
 
 	"gopkg.in/yaml.v3"
@@ -110,7 +109,6 @@ func readConfig() (*EnvironmentConfig, error) {
 
 func init() {
 	if Config, SetupErr = readConfig(); SetupErr != nil {
-		log.Fatal(SetupErr)
-		os.Exit(2)
+		Config = &EnvironmentConfig{}
 	}
 }