Skip to content

Build fails with Go < 1.21 due to slices package dependency #1

Description

@muthusanas

Description

The build fails when using Go versions older than 1.21 because the codebase uses the `slices` package which was introduced in Go 1.21.

Error Message

internal/api/websocket.go:7:2: package slices is not in GOROOT (/usr/lib/go-1.18/src/slices)                                                                                                             

Location

  • File: internal/api/websocket.go:52
  • Usage: slices.ContainsFunc() for origin validation

Suggested Fix

Either:

  1. Document the minimum Go version requirement (Go 1.21+) in README and go.mod
  2. Replace slices.ContainsFunc() with a manual loop for backward compatibility

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions