Answer the question
In order to leave comments, you need to log in
How to initialize a struct within a struct?
There is a structure like this:
type Config struct {
LogLevel int
WriteToConsole bool
WriteToFile struct {
Activated bool
Dir string
Filename string
fullPath string
file *os.File
}
}
var loggerConfig = logger.Config{
LogLevel: 0,
WriteToConsole: false,
WriteToFile: struct {
Activated bool
Dir string
Filename string
fullPath string
file *os.File
}{Activated: true, Dir: "", Filename: ""},
}
var loggerConfig = logger.Config{
LogLevel: 0,
WriteToConsole: false,
WriteToFile: {Activated: true, Dir: "", Filename: ""},
}
Answer the question
In order to leave comments, you need to log in
it was in the non-exported fullPath and file
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question