Skip to content

Commit

Permalink
Fix compiler warnings.
Browse files Browse the repository at this point in the history
Signed-off-by: Aliwoto <aminnimaj@gmail.com>
  • Loading branch information
ALiwoto committed Apr 30, 2024
1 parent 40f5401 commit 5f9b3c9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ssg/strongParser/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5f9b3c9

Please sign in to comment.