Skip to content

Unreachable code in parser.go #170

@marat-rkh

Description

@marat-rkh

Hi!

I am writing a tool to detect unreachable code in Go programs. I used your project to test it and found an issue here:

ini/parser.go

Line 311 in 9c8236e

if identSize > 0 {

This if statement is never executed. This is because the only way to exit the loop above is through return statements.
I tried to remove this statement. Compiler showed that identSize variable became unused. So I removed it also. After that, I ran all the tests and none failed. Not sure if this could be an evidence of some bug in the behavior of the parser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions