Golang Collection

featured image

Suppressing unused function warning in Go

Use this function below to suppress unused function warning in Go, when you like to retain any unused functions (which you plan to use in the future but not remove from your codebase now)

func UNUSED(_ ...interface{}) {}

Usage

func someUnusedFunc(name string, age int) bool { ... }

UNUSED(someUnusedFunc)

wiki go