refactor: improve code readability and maintainability across multiple files

- Reformatted function signatures for better clarity in media.go and onvif-quick/main.go.
- Replaced hardcoded values with constants in ascii.go and server/imaging.go for improved maintainability.
- Enhanced error handling and logging consistency in onvif-diagnostics/main.go and server/server.go.
- Updated comments to clarify functionality and ensure adherence to ONVIF specifications across various files.
This commit is contained in:
0x524a
2025-12-02 08:54:23 -05:00
parent de752f249e
commit 31df3f8b79
10 changed files with 83 additions and 70 deletions
+2 -1
View File
@@ -160,7 +160,8 @@ func (s *Server) Start(ctx context.Context) error {
select {
case <-ctx.Done():
fmt.Println("\n🛑 Shutting down server...")
shutdownCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
const shutdownTimeout = 5 //nolint:mnd // Server shutdown timeout in seconds
shutdownCtx, cancel := context.WithTimeout(context.Background(), shutdownTimeout*time.Second)
defer cancel()
if err := httpServer.Shutdown(shutdownCtx); err != nil {