Skip to content

Commit

Permalink
Revert vgo support
Browse files Browse the repository at this point in the history
Reverts #562 where we added support for vgo.

I'd tested vgo's behavior on a simple synthetic versioned repository
before merging #562, but apparently it wasn't enough because I'm unable
to correctly add stripe-go with vgo even with the addition of a `go.mod`
and corresponding tag.

Here's the resolution error when trying to build a test project:

```
$ vgo build
vgo: resolving import "github.com/stripe/stripe-go/v30"
vgo: finding github.com/stripe/stripe-go/v30 (latest)
vgo: adding github.com/stripe/stripe-go/v30 v30.8.1
vgo: finding github.com/stripe/stripe-go/v30 v30.8.1
vgo: downloading github.com/stripe/stripe-go/v30 v30.8.1
vgo: resolving import "github.com/stripe/stripe-go/form"
vgo: finding github.com/stripe/stripe-go (latest)
vgo: adding github.com/stripe/stripe-go v1.0.3
vgo: import "github.com/brandur/stripe-go-vgo" ->
        import "github.com/stripe/stripe-go/v30": found in both github.com/stripe/stripe-go v1.0.3 and github.com/stripe/stripe-go/v30 v30.8.1
```

I think what's happening is that it correctly sees the `v30.*` tag and resolves
that, but then it starts to descend into subpackages, and eventually finds one
that references the top-level package (almost all of them do, but take
`account/` as an example). The import doesn't use the `stripe/stripe-go/v30`
suffix, and therefore vgo tries to resolve a difference package version (once
again falling back to `v1.0.3`), and produces a conflict.

I think the fix is to make sure all imports end in `/v30`, but this is very
problematic from two angles:

1. It breaks out compatibility with non-vgo installations.
2. It forces us to update the import path on dozens of subpackages every time
   we do a new major release, which is very bad.

For now, I'm going to revert this. Hopefully some progress on vgo in the future
makes this a little easier.
  • Loading branch information
brandur committed May 24, 2018
1 parent 3545a68 commit d08a9fa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ changelog](CHANGELOG) and [API changelog][api-changelog].
go get github.com/stripe/stripe-go
```

Then import the package from your Go code:

``` go
import "github.com/stripe/stripe-go"
```

### vgo

If using [vgo], don't `go get` it manually, but do use an `import` statement
that includes the latest major version:

``` go
import "github.com/stripe/stripe-go/v30"
```

## Documentation

For a comprehensive list of examples, check out the [API
Expand Down Expand Up @@ -328,7 +313,6 @@ pull request][pulls].
[package-management]: https://code.google.com/p/go-wiki/wiki/PackageManagementTools
[pulls]: https://github.com/stripe/stripe-go/pulls
[stripe]: https://stripe.com
[vgo]: https://github.com/golang/vgo

<!--
# vim: set tw=79:
Expand Down
1 change: 0 additions & 1 deletion go.mod

This file was deleted.

0 comments on commit d08a9fa

Please sign in to comment.