GO-CLEAN(1)
β¨ NAME β¨
go-clean β remove object files and cached files π§Ήπ
okay bestie, welcome to the go-clean page from the Go programming tools and commands manual. it's giving "spring cleaning but for your build artifacts" and honestly? obsessed. let's get into it π«Ά
πΈ SYNOPSIS πΈ
go clean [-i] [-r] [-cache] [-testcache] [-modcache] [-fuzzcache] [build
flags] [packages]
π DESCRIPTION π
clean removes object files from package source directories. lowkey important thing to know: the go command builds most objects in a temporary directory, so go clean is mainly concerned with object files left by other tools or by manual invocations of go build. so it's less "cleaning up after go" and more "cleaning up after everything else" π
If a package argument is given, or the -i or -r flag is set, clean removes the following files from each of the source directories corresponding to the import paths. not me giving you the full list, but here it is, no skips:
_obj/β old object directory, left from Makefiles_test/β old test directory, left from Makefiles_testmain.goβ old gotest file, left from Makefilestest.outβ old test log, left from Makefilesbuild.outβ old test log, left from Makefiles*.[568ao]β object files, left from MakefilesDIR(.exe)β fromgo buildDIR.test(.exe)β fromgo test -cMAINFILE(.exe)β fromgo build MAINFILE.go*.soβ from SWIG
In the list, DIR represents the final path element of the directory, and MAINFILE is the base name of any Go source file in the directory that is not included when building the package. iykyk π¦
π OPTIONS π
-iβ causescleanto remove the corresponding installed archive or binary (whatgo installwould create).-nβ causescleanto print the remove commands it would execute, but not run them. window shopping but for deletion ποΈ-rβ causescleanto be applied recursively to all the dependencies of the packages named by the import paths.-xβ causescleanto print remove commands as it executes them.-cacheβ causescleanto remove the entire go build cache.-testcacheβ causescleanto expire all test results in the go build cache.-modcacheβ causescleanto remove the entire module download cache, including unpacked source code of versioned dependencies. yes including the unpacked source, bestie, read that twice π-fuzzcacheβ causescleanto remove files stored in the Go build cache for fuzz testing. quick heads up: the fuzzing engine caches files that expand code coverage, so removing them may make fuzzing less effective until new inputs are found that provide the same coverage. also these files are distinct from those stored intestdatadirectory βcleandoes not remove those files. π
For more about build flags, see go help build.
For more about specifying packages, see go help packages.
π«Ά AUTHOR π«Ά
This manual page was created using help2man and afterwards updating the output. It is maintained by the Debian Go Compiler Team <team+go-compiler@tracker.debian.org> for the Debian project (and may be used by others).
okay that's the whole page, you ate that π this is the go-clean page, part of Go 1.27, dated August 2026, sitting in the Go programming tools and commands manual β go forth and delete responsibly, mwah ππ
π¦ where this page comes from
- ubuntu stonking: golang-go 2:1.27~1 Β· Go
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms