Formatting and added errors to the var header parser

This commit is contained in:
2024-10-27 15:29:48 +00:00
parent eeea06942a
commit fdc53f80e7
5 changed files with 61 additions and 60 deletions
+8 -9
View File
@@ -307,18 +307,17 @@ type Driver struct {
// parseSessionInfo will parse the sessionInfo buffer into the SessionInfoYAML
// struct
func parseSessionInfo(data []byte) (*SessionInfoYAML, error) {
var sessionInfo SessionInfoYAML
err := yaml.Unmarshal(data, &sessionInfo)
if err != nil {
return nil, err
}
var sessionInfo SessionInfoYAML
err := yaml.Unmarshal(data, &sessionInfo)
if err != nil {
return nil, err
}
return &sessionInfo, nil
return &sessionInfo, nil
}
// ToString will return a readable string of the struct
func (s *SessionInfoYAML) ToString() string {
stringified, _ := json.MarshalIndent(s, "", " ")
return string(stringified)
stringified, _ := json.MarshalIndent(s, "", " ")
return string(stringified)
}