Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go: False positive format string detection #61

Open
mcandre opened this issue Sep 1, 2016 · 1 comment
Open

Go: False positive format string detection #61

mcandre opened this issue Sep 1, 2016 · 1 comment

Comments

@mcandre
Copy link

mcandre commented Sep 1, 2016

The Go highlighter sometimes highlights percent signs in strings, even though the usage of the string is not as a C-style printf format string, but an ordinary literal string.

Example:

https://github.com/mcandre/mcandre/blob/master/go/ddg/ddg.go

@AlekSi
Copy link
Contributor

AlekSi commented Jan 21, 2019

Another example:

package main

import (
	"fmt"
)

func main() {
	fmt.Printf("%s %[1]s", "foo")
}

https://play.golang.org/p/5wSu2_WRU0m

See "Explicit argument indexes" at https://golang.org/pkg/fmt/#hdr-Printing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants