fix(revive): rename unused parameters to _ for lint compliance

This commit is contained in:
ryan
2026-06-09 13:46:15 +08:00
parent e06f76436e
commit c6eea8111d
24 changed files with 851 additions and 830 deletions
+2 -1
View File
@@ -17,10 +17,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package router 提供 HTTP 路由注册与服务启动
package router
import "github.com/gin-gonic/gin"
func registerFrontend(r *gin.Engine) {
func registerFrontend(_ *gin.Engine) {
// No-op when not embedding frontend
}
+6 -2
View File
@@ -45,6 +45,7 @@ import (
"github.com/Rain-kl/Wavelet/internal/util"
capUtil "github.com/Rain-kl/Wavelet/internal/util/cap"
// Swagger 文档生成
_ "github.com/Rain-kl/Wavelet/docs"
"github.com/Rain-kl/Wavelet/internal/apps/admin/system_config"
"github.com/Rain-kl/Wavelet/internal/apps/oauth"
@@ -58,6 +59,7 @@ import (
"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
)
// Serve 启动 HTTP API 服务
func Serve() {
// 运行模式
if config.Config.App.IsProduction() {
@@ -267,13 +269,15 @@ func Serve() {
<-quit
shutdownCtx, cancel := context.WithTimeout(context.Background(), time.Duration(config.Config.App.GracefulShutdownTimeout)*time.Second)
defer cancel()
otel_trace.Shutdown(shutdownCtx)
if err := srv.Shutdown(shutdownCtx); err != nil {
log.Fatalf("[API] server forced to shutdown: %v\n", err)
log.Printf("[API] server forced to shutdown: %v\n", err)
cancel()
os.Exit(1)
}
cancel()
log.Println("[API] server exited")
}