AlanQuatermain / go-tmbundle

A TextMate bundle for the Go programming language.
http://alanquatermain.net/
Other
127 stars 40 forks source link

Go: False positive format string detection #61

Open mcandre opened 8 years ago

mcandre commented 8 years ago

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 commented 5 years ago

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.