A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jirfag/go-printf-func-name below:

golangci/go-printf-func-name: Linter checks that printf-like functions are named with `f` at the end.

Repository files navigation go-printf-func-name

The Go linter go-printf-func-name checks that printf-like functions are named with f at the end.

Example

myLog should be named myLogf by Go convention:

package main

import "log"

func myLog(format string, args ...interface{}) {
	const prefix = "[my] "
	log.Printf(prefix + format, args...)
}
$ go vet -vettool=$(which go-printf-func-name) ./...
./main.go:5:1: printf-like formatting function 'myLog' should be named 'myLogf'

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4