golang-backend-development

Warn

Audited by Runlayer on Feb 21, 2026

Risk Level: MEDIUM
Scan Summary
Max Score
78%
Files
3
Flagged
3
Chunks
16
Flagged Files (3)
EXAMPLES.mdHIGH
78.3%

Malicious tool definition detected

Tool: EXAMPLES.md [1/8] Description: # Go Backend Development Examples > 25+ practical, production-ready examples demonstrating Go backend patterns, from basic HTTP servers to advanced microservices. ## Table of Contents 1.

Tool: EXAMPLES.md [2/8] Description: context func httpDo(ctx context.Context, req *http.Request, f func(*http.Response, error) error) error { client := &http.Client{} ch := make(chan error, 1) go func() { ch <- f(client.Do(req)) }() select { case <-ctx.Done(): // Wait for f to return <-ch return ctx.Err() case err := <-ch: return err } } ``` **Use Case**: Preventing long-running requests, enforcing SLAs, cancellation **Key Concepts**: - Context for cancellation and timeouts - Select statement fo

Tool: EXAMPLES.md [3/8] Description: context.Context, user *User) error { query := ` INSERT INTO users (name, email, created_at, updated_at) VALUES ($1, $2, NOW(), NOW()) RETURNING id, created_at, updated_at ` err := r.db.QueryRowContext(ctx, query, user.Name, user.Email).Scan( &user.ID, &user.CreatedAt, &user.UpdatedAt, ) return err } // Get user by ID func (r *UserRepository) GetByID(ctx context.Context, id int) (*User, error) { user := &User{} query := ` SELECT id, name, email, created_at, up

Tool: EXAMPLES.md [4/8] Description: := srv.Shutdown(ctx); err != nil { log.Fatalf("Server forced to shutdown: %v", err) } log.Println("Server exited gracefully") } func setupRoutes() http.Handler { mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { // Simulate long request time.Sleep(2 * time.Second) w.Write([]byte("Hello, World!")) }) return mux } // Complete shutdown example with cleanup type Application struct { server *http.Server db *sql.DB logger

Tool: EXAMPLES.md [5/8] Description: := NewHub() go hub.Run() http.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) { serveWs(hub, w, r) }) log.Println("WebSocket server starting on :8080") log.Fatal(http.ListenAndServe(":8080", nil)) } ``` **Use Case**: Chat applications, real-time dashboards, live notifications **Key Concepts**: - WebSocket upgrade - Hub pattern for broadcasting - Read/write pumps - Client management --- ## 14.

Tool: EXAMPLES.md [6/8] Description: time.Now() body, err := json.Marshal(event) if err != nil { return err } return p.channel.PublishWithContext( ctx, "events", // exchange event.Type, // routing key false, // mandatory false, // immediate amqp.Publishing{ ContentType: "application/json", Body: body, }, ) } func (p *EventPublisher) Close() { p.channel.Close() p.conn.Close() } type EventHandler func(Event) error type EventConsumer struct { conn *amqp.Connection channel *amqp.Channel handlers map

Tool: EXAMPLES.md [7/8] Description: != nil { http.Error(w, "Invalid token", http.StatusUnauthorized) return } // Add claims to context ctx := context.WithValue(r.Context(), userContextKey, claims) next.ServeHTTP(w, r.WithContext(ctx)) }) } func getUserFromContext(ctx context.Context) (*Claims, bool) { claims, ok := ctx.Value(userContextKey).(*Claims) return claims, ok } // Handler example func protectedHandler(w http.ResponseWriter, r *http.Request) { claims, ok := getUserFromContext(r.Context(

Description: Request routing - Service discovery integration - Load balancing - Response aggregation --- **Version**: 1.0.0 **Last Updated**: October 2025 **Total Examples**: 25+ production-ready patterns

README.mdHIGH
78.3%

Malicious tool definition detected

Tool: README.md [1/3] Description: # Go Backend Development Skill > Complete guide for building production-grade backend systems with Go, emphasizing concurrency patterns, web servers, and microservices architecture.

Tool: README.md [2/3] Description: go.mod # Module definition ├── go.sum # Dependency checksums └── README.md ``` **Key Directories:** - `cmd/`: Main applications for this project - `internal/`: Private application code (cannot be imported by other projects) - `pkg/`: Public library code (can be imported by other projects) - `api/`: API definitions and protocols - `migrations/`: Database schema migrations ## Development Workflow ### 1. Initialize Project ```bash mkdir myproject && cd myproject g

Tool: README.md [3/3]

SKILL.mdHIGH
78.3%

Malicious tool definition detected

Tool: SKILL.md [1/5] Description: --- name: golang-backend-development description: Complete guide for Go backend development including concurrency patterns, web servers, database integration, microservices, and production deployment tags: [golang, go, concurrency, web-servers, microservices, backend, goroutines, channels, grpc, rest-api] tier: tier-1 --- # Go Backend Development A comprehensive skill for building production-grade backend systems with Go.

Tool: SKILL.md [2/5] Description: APIHandler struct { db *sql.DB logger *log.Logger } func (h *APIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Access dependencies h.logger.Printf("Request: %s %s", r.Method, r.URL.Path) // Handle request } ``` ### Middleware Pattern **Logging Middleware:** ```go func loggingMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { start := time.Now() next.ServeHTTP(w, r) log.Printf("%s %

Description: err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { if err != nil { return err } if !info.Mode().IsRegular() { return nil } data, err := ioutil.ReadFile(path) if err != nil { return err } m[path] = md5.Sum(data) return nil }) return m, err } ``` **Parallel MD5 with Pipeline:** ```go type result struct { path string sum [md5.Size]byte err error } func sumFiles(done <-chan struct{}, root string) (<-chan result, <-chan error) { c := make(chan result) errc

Tool: SKILL.md [4/5] Description: } // Start server in goroutine go func() { if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed { log.Fatalf("listen: %s ", err) } }() // Wait for interrupt signal quit := make(chan os.Signal, 1) signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) <-quit log.Println("Shutting down server...") // Graceful shutdown with timeout ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() if err := srv.Shutdown(ctx);

Tool: SKILL.md [5/5] Description: // RACE CONDITION } func LookupService(name string) net.Addr { return service[name] // RACE CONDITION } ``` **Solution:** ```go var ( service map[string]net.Addr serviceMu sync.Mutex ) func RegisterService(name string, addr net.Addr) { serviceMu.Lock() defer serviceMu.Unlock() service[name] = addr } ``` ### 2.

Audit Metadata
Max File Score
78%
Classification
UNKNOWN_SERVER
Files Scanned
3
Files Flagged
3
Chunks Analyzed
16
Analyzed
Feb 21, 2026, 06:59 PM
Security Audit — runlayer — golang-backend-development