Open mcandre opened 8 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.
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