ncw / swift

Go language interface to Swift / Openstack Object Storage / Rackspace cloud files (golang)
MIT License
310 stars 107 forks source link

feat: start v2 major version and add context to functions #164

Closed FUSAKLA closed 3 years ago

FUSAKLA commented 3 years ago

Resolves #159 #161 Replaces #162

As discussed here https://github.com/ncw/swift/pull/162#issuecomment-751459979 I'm bumping the new v2 major version in the go.mod and adding context to all the functions without changing their names.

PTAL @ncw

ncw commented 3 years ago

To get the build passing we're going to have to ditch the old Go versions...

I've added a commit which does that, and another which fixes gofmt

Let's see what happens!

ncw commented 3 years ago

Ooh, build passed!

Will review again now.

ncw commented 3 years ago

Note the tests are failing with

# github.com/ncw/swift/v2_test [github.com/ncw/swift/v2.test]
./swift_test.go:268:17: too many arguments in call to out.Close
    have (context.Context)
    want ()
FUSAKLA commented 3 years ago

Right, tests should be fixed now and context added everywhere so hopefully should be OK now.

FUSAKLA commented 3 years ago

Ok, so hopefully it's good to go now :) Thanks for the swift review and feel free to change the commit message as you see fit, commits should be squashed now.

ncw commented 3 years ago

Thank you very much for this :-)

I'll merge this, then tag a v2.0.0 release!

I'll also update rclone to use the v2 version which should hopefully shed light on any remaining problems.

I've made a v1 branch just in case it needs to be updated.