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 mod is not work with structomap #3

Closed
cemkiy opened this issue May 14, 2019 · 5 comments
Closed

go mod is not work with structomap #3

cemkiy opened this issue May 14, 2019 · 5 comments

Comments

@cemkiy
Copy link
Contributor

cemkiy commented May 14, 2019

I am trying to use go modules. But my packages are giving error after go build command.

my code

import (
	"github.com/danhper/structomap"
)

// Serializer used in constructing maps to output JSON
type Serializer struct {
	*structomap.Base
}

output

./models.go:<line number>: imported and not used: "github.com/tuvistavie/structomap" as serializer
./models.go:<line number>: undefined: structomap
@danhper
Copy link
Owner

danhper commented May 16, 2019

Hi.
I changed my username at some point, which might be what is causing the issue.
All occurrences of github.com/tuvistavie/structomap should now be github.com/danhper/structomap.
Could you please check that this is the case?
Thanks.

@cemkiy
Copy link
Contributor Author

cemkiy commented May 17, 2019

I noticed that situation too. I have tried with danhper and error is not gone. I have tried with my fork(github.com/cemkiy/structomap) and error is not gone. I am working on it.

@cemkiy
Copy link
Contributor Author

cemkiy commented May 24, 2019

Okey, i tried many things then found the solution.

$ go mod init
$ go build
$ go get github.com/danhper/structomap@0.6.1

Why we need the last command?

After go build command, structomap version is v0.1.0. But your last version is 0.6.1. Therefore go mod is giving errors.

I tried get your last release and done.

And the question is why go mod getting old version?
My answer is probably "v" letter. Your first release is v0.1.0, but other releases are only starting with 0, not including v letter. This is maybe fixed all problems.

@danhper
Copy link
Owner

danhper commented May 24, 2019

Interesting. Thanks for looking into this.
I just pushed a tag v0.6.2 to see if it makes any difference.
Could you let me know how that goes please?
Thanks a lot!

@cemkiy
Copy link
Contributor Author

cemkiy commented May 27, 2019

it's worked.

go.mod output is:

github.com/danhper/structomap v0.6.2

go.sum output is:

github.com/danhper/structomap v0.6.2 h1:VryUhPR3Ju+FeXHXTL2RGPbRmIX/mN768jULh9weylM=
github.com/danhper/structomap v0.6.2/go.mod h1:qmif0PLXZftsShsS0miHLhWv4VRR8awMUPnYxHAJCjg=

I found this website on my researches. https://research.swtch.com/vgo-module#from_repository_to_modules

it says

The leading v is required, and having three numbers is also required.

thanks for your interest.we can close issue.

@cemkiy cemkiy closed this as completed May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants