Skip to content

Installation

  • Go 1.21+ - Fox requires Go version 1.21 or higher
  • Git - For version control and dependency management

The simplest way to install Fox is using go get:

Terminal window
go get -u github.com/fox-gonic/fox

This will download Fox and its dependencies, including Gin.

If you’re starting a new project:

Terminal window
# Create a new directory
mkdir myproject
cd myproject
# Initialize Go module
go mod init myproject
# Install Fox
go get -u github.com/fox-gonic/fox

To install a specific version of Fox:

Terminal window
go get github.com/fox-gonic/fox@v0.1.0

Create a simple test file main.go:

package main
import (
"github.com/fox-gonic/fox"
)
func main() {
r := fox.Default()
r.GET("/ping", func() string {
return "pong"
})
r.Run(":8080")
}

Run it:

Terminal window
go run main.go

Visit http://localhost:8080/ping in your browser. You should see “pong”.

  • Air - Live reload for Go apps

    Terminal window
    go install github.com/cosmtrek/air@latest
  • Delve - Go debugger

    Terminal window
    go install github.com/go-delve/delve/cmd/dlv@latest

VS Code

Install the Go extension:

  • Provides IntelliSense, debugging, and more
  • Configure gopls for best experience

GoLand

GoLand has built-in support for Go. Just open your project and you’re ready to go.

To update to the latest version:

Terminal window
go get -u github.com/fox-gonic/fox
go mod tidy

If you encounter import cycle errors, ensure your project structure is clean and you’re not creating circular dependencies.

Fox depends on a specific version of Gin. If you have version conflicts:

Terminal window
go mod tidy
go clean -modcache
go get -u github.com/fox-gonic/fox

If you encounter build errors:

  1. Ensure you’re using Go 1.21+: go version
  2. Clean your module cache: go clean -modcache
  3. Re-download dependencies: go mod download