Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go import error local vs vendored package #41411

Closed
Anjali-Saha opened this issue Sep 15, 2020 · 2 comments
Closed

go import error local vs vendored package #41411

Anjali-Saha opened this issue Sep 15, 2020 · 2 comments

Comments

@Anjali-Saha
Copy link

@Anjali-Saha Anjali-Saha commented Sep 15, 2020

What version of Go are you using (go version)?

1.10

Does this issue reproduce with the latest release? NA

What operating system and processor architecture are you using (go env)? mac os

go env Output
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/asaha/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/asaha/Development/GO"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/r4/dkc4bc615112bvpdxk_nlwtd0jp9hj/T/go-build513884398=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

What did you expect to see?

the service running. I have run the service many times and not received this error. not sure why I am all of a sudden getting this now.

What did you see instead?

cannot use bs (type *"company/framework".WebService) as type *"company/utilities/message/vendor/company/framework".WebService in argument to message.SetupMessageService

---- Code snippets ----------

package main

import (
"log"
"company/framework"
"company/utilities/message"
)

func init() {
framework.SetupEnv(framework.ProcessTypeUtilityService)
}

func main() {
bs := framework.NewUtilityService(message.ServiceName)
message.InitializeRequiredServices()
message.SetupMessageService(bs) //line that errors

// Start the service
err := bs.Start()
if err != nil {
	log.Fatal("Could not start utilitiy service ", message.ServiceName, ": ", err)
}

}

import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"

"golang.org/x/net/context"
"company/framework"
"company/framework/twlog"
"company/utilities/message/api"

)

// function that error line calls
func SetupMessageService(bs *framework.WebService) {
...

@tpaschalis
Copy link
Contributor

@tpaschalis tpaschalis commented Sep 16, 2020

Hello, and thanks for raising this issue! The type you're passing in is incompatible; on your example SetupMessageService is both a function and a method, so there's probably a mixup there.

That being said, unlike other projects, the Go project doesn't use GitHub Issues for general discussion or questions.

You'll find some better venues for asking questions on https://golang.org/wiki/Questions

@davecheney
Copy link
Contributor

@davecheney davecheney commented Sep 16, 2020

As @tpaschalis has mentioned we don’t use the issue tracker for questions about using go. Also, go 1.10 is beyond the supported window so before we could investigate you should upgrade to go 1.15.2 or later.

For asking questions, see:

@davecheney davecheney closed this Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.