Skip to content

Instantly share code, notes, and snippets.

@benmezger benmezger/go-build-error
Last active Dec 16, 2019

Embed
What would you like to do?
$ go build ./internal/bands
internal/bands/bands.go:5:2: module github.com/go-chi/chi@latest found (v4.0.2+incompatible), but does not contain package github.com/go-chi/chi/render
internal/bands/bands.go:6:2: malformed module path "internal/io": missing dot in first path element
module bands-api
replace github.com/benmezger/bands-api => ./internal/
go 1.13
require github.com/go-chi/chi v4.0.2+incompatible // indirect
package main
import (
"./internal/bands"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"net/http"
)
func BaseRoutes() *chi.Mux {
router := chi.NewRouter()
router.Use(
middleware.RequestID,
middleware.RealIP,
middleware.RedirectSlashes,
middleware.Logger,
middleware.Recoverer,
)
return router
}
func main() {
router := BaseRoutes()
router.Route("/v1", func(r chi.Router) {
r.Mount("/api/artists", bands.Routes())
})
http.ListenAndServe(":8080", router)
}
$ go build cmd/main.go 130 ↵ ᚴ upstream ! master 5A
cmd/main.go:4:2: cannot find package "." in:
/Users/benmezger/workspace/bands/src/cmd/internal/bands
workspace/bands/src ∙ tree 1 ↵ ᚴ upstream ! master 5A
.
├── cmd
│   └── main.go
└── internal
├── bands
│   └── bands.go
├── data
│   └── types.go
├── internal.go
└── io
└── io.go
5 directories, 5 files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.