Skip to content

golangci/go-printf-func-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c9b07d8 · Mar 25, 2025

History

10 Commits
Mar 25, 2025
Oct 19, 2024
Mar 25, 2025
Nov 10, 2019
Oct 19, 2024
Oct 19, 2024
Mar 25, 2025
Oct 19, 2024
Oct 19, 2024
Oct 19, 2024
Mar 25, 2025
Mar 25, 2025

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'