Answer the question
In order to leave comments, you need to log in
Why doesn't the compiler see packages imported from a module's local package?
The imported package (github.com/texttheater/golang-levenshtein/levenshtein) worked fine until the functionality, together with the import of this package, was moved to a separate local package (/pkg/analyzer).
Was:
login_watch/main.go:
package main
import (
"container/list"
"fmt"
"github.com/texttheater/golang-levenshtein/levenshtein"
"time"
"encoding/json"
"log"
"net/http"
"sync"
"github.com/gorilla/mux"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
)
...
package main
import (
"container/list"
"fmt"
"github.com/mustikkakeitto/login_watch/pkg/analyzer"
"time"
"encoding/json"
"log"
"net/http"
"sync"
"github.com/gorilla/mux"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
)
...
// Package analyzer implements functions to detect series
// built from the particular phone numbers
package analyzer
import (
"container/list"
"fmt"
"time"
"github.com/texttheater/golang-levenshtein/levenshtein"
"log"
)
...
\login_watch>go run .
pkg\analyzer\series.go:10:2: cannot find package
module github.com/mustikkakeitto/login_watch
go 1.16
require (
github.com/gorilla/mux v1.8.0
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
github.com/lestrrat-go/strftime v1.0.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/texttheater/golang-levenshtein/levenshtein v0.0.0-20200805054039-cae8b0eaed6c // indirect
)
C:.
│ build4linux.cmd
│ Dockerfile
│ go.mod
│ go.sum
│ main.go
│
├───bin
├───log
└───pkg
└───analyzer
series.go
series_test.go
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question