Tags

2 pages

Golang

Find all functions not referenced in the Go project.

In a Go language project, using staticcheck to find unused functions is an efficient static analysis method. 1. Install staticcheck Ensure that Go (version 1.16+) is installed, and then execute the following command to install staticcheck: go install honnef.co/go/tools/cmd/staticcheck@latest 2. Basic Usage: Finding Unused Functions Run the following command in the project root directory: staticcheck ./... Key Check Rules: U1000: Detects unused functions, methods, variables, or types. U1001: Detects unused parameters.

Why Do We Need to Learn a New Language?

Starting from my academic years, I’ve been working with C++ for over ten years. So, why do I need to learn other programming languages? Work experience: Lacking experience in elegant module design, C++ syntax is freeform. Learning other languages helps me guide the development of more elegant designs. I often use them when writing some tools. The design principles for low-level libraries and business modules are also becoming clearer.