The error occurs because Go requires every imported package to be used at least once in the code. If you import a package but do not call any of its functions, types, or constants, the compiler flags it as unused. To fix this, either use the imported package or replace the import with a blank identifier to explicitly ignore it.
import (
_ "unused/package"
)
Alternatively, if you intended to use the package, ensure you reference a symbol from it, such as fmt.Println("hello") for the fmt package.