agiledragon / gomonkey

gomonkey is a library to make monkey patching in unit tests easy
MIT License
2k stars 179 forks source link

Add v2.2.0 to Version List #61

Closed derryflag closed 3 years ago

derryflag commented 3 years ago

Please add v2.2.0 to version list It's very great to hear arm is supported in v2.2.0, however, when try to use v2.2.0, I meet error go get: github.com/agiledragon/gomonkey@v2.2.0: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2

get https://goproxy.io/github.com/agiledragon/gomonkey/@v/list will only return v2.0.1+incompatible v2.0.2+incompatible But v2.2.0 is missing, could you help add it?

agiledragon commented 3 years ago

I have added v2.2.0 for 24 days, you can see this page that url is https://github.com/agiledragon/gomonkey/releases. You should import gomonkey package like "github.com/agiledragon/gomonkey/v2", and not like "github.com/agiledragon/gomonkey". I added go.mod file for gomonkey in v2.1.0

You can refer to the test file that is "https://github.com/agiledragon/gomonkey/blob/master/test/apply_func_test.go".

import (
    "encoding/json"
    "testing"

    . "github.com/agiledragon/gomonkey/v2"
    "github.com/agiledragon/gomonkey/v2/test/fake"
    . "github.com/smartystreets/goconvey/convey"
)
derryflag commented 3 years ago

Thanks a lot, with gomonkey/v2 it works fine.