Skip to content

Regression of '#nosec' handling  #1046

Closed
@skabashnyuk

Description

@skabashnyuk

Summary

//#nosec G101 does not work in =v2.18.1

Steps to reproduce the behavior

Create new project

$ mkdir gosec-check && cd gosec-check
$ touch main.go
$ touch labels.go
$ touch go.mod

main.go

package main

import (
	"fmt"
)

func main() {
	fmt.Printf("Label: %s ", TokenLabel)
}

labels.go

package main

const TokenLabel = "test/linked-access-token" //#nosec G101 -- false positive, this is not a private data

go.mod

module example.com/m

go 1.21.3

gosec version

  • 2.18.1 -github action

Go version (output of 'go version')

  • from image

Operating system / Environment

  • Github actions/docker image securego/gosec:2.18.1

Expected behavior

Line with #nosec G101 is not reported

Actual behavior

Line is reported as issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions