slayercat / GoSNMPServer

GoSNMPServer is an SNMP server library fully written in Go. It provides Server Get, GetNext, GetBulk, Walk, BulkWalk, Set and Traps. It supports IPv4 and IPv6, using SNMPv2c or SNMPv3.
BSD 2-Clause "Simplified" License
95 stars 50 forks source link

go mod tidy #6

Closed pierreyves258 closed 2 years ago

pierreyves258 commented 2 years ago

Hi, When i do a go mod tidy on my project using GoSNMPServer I got this error

go: found github.com/soniah/gosnmp in github.com/soniah/gosnmp v1.34.0
go: ./services imports
        github.com/slayercat/gosnmp tested by
        github.com/slayercat/gosnmp.test imports
        github.com/soniah/gosnmp: github.com/soniah/gosnmp@v1.34.0: parsing go.mod:
        module declares its path as: github.com/gosnmp/gosnmp
                but was required as: github.com/soniah/gosnmp

I think it comes form the fact that github.com/soniah/gosnmp is now github.com/gosnmp/gosnmp but I don't know how to fix it

Thanks

pierreyves258 commented 2 years ago

I thinks this may fix the issue https://github.com/slayercat/gosnmp/pull/1

slayercat commented 2 years ago

thanks for submitting this ticket~ the MR you mentioned has been merged. would you mind to have it a test?

vincentbernat commented 2 years ago

It works for me.

slayercat commented 2 years ago

thanks

harenber commented 2 years ago

Is that really solved? I just tried to build a simple application today, but still getting the same error message.

There seem to be a lot of references to soniah/gosnmp for example https://github.com/slayercat/gosnmp/blob/master/mocks/gosnmp_mock.go#L12

Torsten-Harenbergs-MacBook-Air-2:clusim harenber$ go clean -modcache
Torsten-Harenbergs-MacBook-Air-2:clusim harenber$ rm go.mod 
Torsten-Harenbergs-MacBook-Air-2:clusim harenber$ go mod init
go: creating new go.mod: module clusim
go: to add module requirements and sums:
        go mod tidy
Torsten-Harenbergs-MacBook-Air-2:clusim harenber$ go mod tidy
go: finding module for package github.com/slayercat/gosnmp
go: finding module for package github.com/slayercat/GoSNMPServer
go: finding module for package github.com/slayercat/GoSNMPServer/mibImps
go: downloading github.com/slayercat/gosnmp v1.24.0
go: downloading github.com/slayercat/GoSNMPServer v0.1.2
go: found github.com/slayercat/GoSNMPServer in github.com/slayercat/GoSNMPServer v0.1.2
go: found github.com/slayercat/GoSNMPServer/mibImps in github.com/slayercat/GoSNMPServer v0.1.2
go: found github.com/slayercat/gosnmp in github.com/slayercat/gosnmp v1.24.0
go: downloading github.com/stretchr/testify v1.4.1-0.20200129000828-ea72eb91592e
go: downloading github.com/sirupsen/logrus v1.4.2
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/shirou/gopsutil v2.19.12+incompatible
go: downloading github.com/prometheus/procfs v0.0.8
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.1
go: downloading golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v2 v2.2.2
go: downloading github.com/google/go-cmp v0.3.1
go: finding module for package github.com/soniah/gosnmp
go: finding module for package github.com/StackExchange/wmi
go: downloading github.com/StackExchange/wmi v1.2.1
go: downloading github.com/soniah/gosnmp v1.35.0
go: found github.com/StackExchange/wmi in github.com/StackExchange/wmi v1.2.1
go: found github.com/soniah/gosnmp in github.com/soniah/gosnmp v1.35.0
go: clusim imports
        github.com/slayercat/gosnmp tested by
        github.com/slayercat/gosnmp.test imports
        github.com/soniah/gosnmp: github.com/soniah/gosnmp@v1.35.0: parsing go.mod:
        module declares its path as: github.com/gosnmp/gosnmp
                but was required as: github.com/soniah/gosnmp
Torsten-Harenbergs-MacBook-Air-2:clusim harenber$ 

Thanks!

vincentbernat commented 2 years ago

No version was released with a fix. You need to add this to go.mod:

replace github.com/slayercat/gosnmp => github.com/slayercat/gosnmp v1.24.1-0.20220124233957-4b805977d286
slayercat commented 2 years ago

Thanks for your comment, Just made a release to fix it. @vincentbernat @harenber

Please feel free to reopen or file a new issue if you are encountering a similar or related problem.