From 5f9b3c9b55fbe9fd7bed2fbfe14a0ba876201a71 Mon Sep 17 00:00:00 2001 From: Aliwoto Date: Tue, 30 Apr 2024 07:59:36 +0330 Subject: [PATCH] Fix compiler warnings. Signed-off-by: Aliwoto --- ssg/strongParser/helpers.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ssg/strongParser/helpers.go b/ssg/strongParser/helpers.go index 23d8137..9f61b7c 100644 --- a/ssg/strongParser/helpers.go +++ b/ssg/strongParser/helpers.go @@ -103,7 +103,7 @@ func ParseConfigWithOption(value any, filename string, opt *ConfigParserOptions) func ParseMainAndArrays[mT any, aT any](filename string, opt *ConfigParserOptions) (*MainAndArrayContainer[mT, aT], error) { p, err := Parse(filename) if err != nil { - if opt == nil && !opt.ReadEnv { + if opt == nil || !opt.ReadEnv { return nil, err } @@ -117,7 +117,7 @@ func ParseMainAndArrays[mT any, aT any](filename string, opt *ConfigParserOption func ParseMainAndArraysStr[mT any, aT any](valueStr string, opt *ConfigParserOptions) (*MainAndArrayContainer[mT, aT], error) { p, err := parseString(valueStr) if err != nil { - if opt == nil && !opt.ReadEnv { + if opt == nil || !opt.ReadEnv { return nil, err } @@ -571,10 +571,9 @@ func parseFile(file *os.File) (*ConfigParser, error) { reader := bufio.NewReader(file) var lineNo int - var err error var curSect *Section - for err == nil { + for { l, _, err := reader.ReadLine() if err != nil { break