mirror of
https://github.com/aykhans/dodo.git
synced 2025-07-02 16:25:40 +00:00
🔨 Add constructors to config structs
This commit is contained in:
@ -12,12 +12,8 @@ import (
|
||||
|
||||
func CLIConfigReader() (*config.CLIConfig, error) {
|
||||
var (
|
||||
returnNil = false
|
||||
cliConfig = &config.CLIConfig{
|
||||
Config: config.Config{
|
||||
NoProxyCheck: utils.NewNoneOption[bool](),
|
||||
},
|
||||
}
|
||||
returnNil = false
|
||||
cliConfig = config.NewCLIConfig(config.NewConfig("", 0, 0, 0, nil), false, "")
|
||||
dodosCount uint
|
||||
requestCount uint
|
||||
timeout uint32
|
||||
|
@ -6,7 +6,6 @@ import (
|
||||
|
||||
"github.com/aykhans/dodo/config"
|
||||
customerrors "github.com/aykhans/dodo/custom_errors"
|
||||
"github.com/aykhans/dodo/utils"
|
||||
)
|
||||
|
||||
func JSONConfigReader(filePath string) (*config.JSONConfig, error) {
|
||||
@ -14,11 +13,10 @@ func JSONConfigReader(filePath string) (*config.JSONConfig, error) {
|
||||
if err != nil {
|
||||
return nil, customerrors.OSErrorFormater(err)
|
||||
}
|
||||
jsonConf := &config.JSONConfig{
|
||||
Config: config.Config{
|
||||
NoProxyCheck: utils.NewNoneOption[bool](),
|
||||
},
|
||||
}
|
||||
jsonConf := config.NewJSONConfig(
|
||||
config.NewConfig("", 0, 0, 0, nil),
|
||||
nil, nil, nil, nil, nil,
|
||||
)
|
||||
err = json.Unmarshal(data, &jsonConf)
|
||||
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user