Skip to content

Commit

Permalink
Version v2.0.0-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobgy committed Feb 5, 2022
1 parent b0de8f6 commit 29b2d5d
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion check.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"os"

"github.com/google/go-licenses/licenses"
"github.com/Bobgy/go-licenses/v2/licenses"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"

"github.com/golang/glog"
"github.com/google/go-licenses/licenses"
"github.com/Bobgy/go-licenses/v2/licenses"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/google/go-licenses
module github.com/Bobgy/go-licenses/v2

go 1.16

Expand Down
2 changes: 1 addition & 1 deletion internal/third_party/pkgsite/source/meta-tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"io"
"strings"

"github.com/google/go-licenses/internal/third_party/pkgsite/derrors"
"github.com/Bobgy/go-licenses/v2/internal/third_party/pkgsite/derrors"
)

// This code adapted from https://go.googlesource.com/gddo/+/refs/heads/master/gosrc/gosrc.go.
Expand Down
6 changes: 3 additions & 3 deletions internal/third_party/pkgsite/source/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (
"strings"
"time"

"github.com/google/go-licenses/internal/third_party/pkgsite/derrors"
"github.com/google/go-licenses/internal/third_party/pkgsite/stdlib"
"github.com/google/go-licenses/internal/third_party/pkgsite/version"
"github.com/Bobgy/go-licenses/v2/internal/third_party/pkgsite/derrors"
"github.com/Bobgy/go-licenses/v2/internal/third_party/pkgsite/stdlib"
"github.com/Bobgy/go-licenses/v2/internal/third_party/pkgsite/version"
"go.opencensus.io/plugin/ochttp"
"go.opencensus.io/trace"
"golang.org/x/net/context/ctxhttp"
Expand Down
4 changes: 2 additions & 2 deletions internal/third_party/pkgsite/stdlib/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"fmt"
"strings"

"github.com/google/go-licenses/internal/third_party/pkgsite/derrors"
"github.com/google/go-licenses/internal/third_party/pkgsite/version"
"github.com/Bobgy/go-licenses/v2/internal/third_party/pkgsite/derrors"
"github.com/Bobgy/go-licenses/v2/internal/third_party/pkgsite/version"
"golang.org/x/mod/semver"
)

Expand Down
8 changes: 4 additions & 4 deletions licenses/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"time"

"github.com/golang/glog"
"github.com/google/go-licenses/internal/third_party/pkgsite/source"
"github.com/Bobgy/go-licenses/v2/internal/third_party/pkgsite/source"
"golang.org/x/tools/go/packages"
)

Expand Down Expand Up @@ -228,7 +228,7 @@ func (l *Library) LicenseURL(ctx context.Context) (string, error) {
// This always happens for the module in development.
// Note#1 if we pass version=HEAD to source.ModuleInfo, github tag for modules not at the root
// of the repo will be incorrect, because there's a convention that:
// * I have a module at github.com/google/go-licenses/submod.
// * I have a module at github.com/Bobgy/go-licenses/v2/submod.
// * The module is of version v1.0.0.
// Then the github tag should be submod/v1.0.0.
// In our case, if we pass HEAD as version, the result commit will be submod/HEAD which is incorrect.
Expand All @@ -239,7 +239,7 @@ func (l *Library) LicenseURL(ctx context.Context) (string, error) {
// always refers to the default branch, so it's better than
// both of master/main when we do not know which branch is default.
// Examples:
// * https://github.com/google/go-licenses/blob/HEAD/LICENSE
// * https://github.com/Bobgy/go-licenses/v2/blob/HEAD/LICENSE
// points to latest commit of master branch.
// * https://github.com/google/licenseclassifier/blob/HEAD/LICENSE
// points to latest commit of main branch.
Expand Down Expand Up @@ -286,7 +286,7 @@ func (l *Library) LicenseURL(ctx context.Context) (string, error) {
// When module is at a subdir, the LICENSE file we find at root
// of the module may actually lie in the root of the repo, due
// to special go module behavior.
// Reference: https://github.com/google/go-licenses/issues/73#issuecomment-1005587408.
// Reference: https://github.com/Bobgy/go-licenses/v2/issues/73#issuecomment-1005587408.
url2 := remote.RepoFileURL("LICENSE")
rawURL2 := remote.RepoRawURL("LICENSE")
if url2 == url {
Expand Down
20 changes: 10 additions & 10 deletions licenses/library_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,28 @@ func TestLibraries(t *testing.T) {
}{
{
desc: "Detects direct dependency",
importPath: "github.com/google/go-licenses/licenses/testdata/direct",
importPath: "github.com/Bobgy/go-licenses/v2/licenses/testdata/direct",
wantLibs: []string{
"github.com/google/go-licenses/licenses/testdata/direct",
"github.com/google/go-licenses/licenses/testdata/indirect",
"github.com/Bobgy/go-licenses/v2/licenses/testdata/direct",
"github.com/Bobgy/go-licenses/v2/licenses/testdata/indirect",
},
},
{
desc: "Detects transitive dependency",
importPath: "github.com/google/go-licenses/licenses/testdata",
importPath: "github.com/Bobgy/go-licenses/v2/licenses/testdata",
wantLibs: []string{
"github.com/google/go-licenses/licenses/testdata",
"github.com/google/go-licenses/licenses/testdata/direct",
"github.com/google/go-licenses/licenses/testdata/indirect",
"github.com/Bobgy/go-licenses/v2/licenses/testdata",
"github.com/Bobgy/go-licenses/v2/licenses/testdata/direct",
"github.com/Bobgy/go-licenses/v2/licenses/testdata/indirect",
},
},
{
desc: "Build tagged package",
importPath: "github.com/google/go-licenses/licenses/testdata/tags",
importPath: "github.com/Bobgy/go-licenses/v2/licenses/testdata/tags",
goflags: "-tags=tags",
wantLibs: []string{
"github.com/google/go-licenses/licenses/testdata/tags",
"github.com/google/go-licenses/licenses/testdata/indirect",
"github.com/Bobgy/go-licenses/v2/licenses/testdata/tags",
"github.com/Bobgy/go-licenses/v2/licenses/testdata/indirect",
},
},
} {
Expand Down
4 changes: 2 additions & 2 deletions licenses/testdata/direct/direct.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package direct

import (
// This import should be ignored, since it's an internal dependency.
_ "github.com/google/go-licenses/licenses/testdata/direct/subpkg"
_ "github.com/Bobgy/go-licenses/v2/licenses/testdata/direct/subpkg"
// This import should be detected as being a transitive dependency of whatever
// imports this package.
_ "github.com/google/go-licenses/licenses/testdata/indirect"
_ "github.com/Bobgy/go-licenses/v2/licenses/testdata/indirect"
)
2 changes: 1 addition & 1 deletion licenses/testdata/tags/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ package tags
import (
// This import should be detected as being a transitive dependency of whatever
// imports this package.
_ "github.com/google/go-licenses/licenses/testdata/indirect"
_ "github.com/Bobgy/go-licenses/v2/licenses/testdata/indirect"
)
4 changes: 2 additions & 2 deletions licenses/testdata/testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
// package that isn't in the standard library and has a separate license
// file to the one covering the Trillian repository, so that it's detected
// as being an external dependency.
_ "github.com/google/go-licenses/licenses/testdata/direct"
_ "github.com/Bobgy/go-licenses/v2/licenses/testdata/direct"

// This import should be ignored, since it's an internal dependency.
_ "github.com/google/go-licenses/licenses/testdata/internal"
_ "github.com/Bobgy/go-licenses/v2/licenses/testdata/internal"

// This import should be ignored, since it's an standard library package.
_ "strings"
Expand Down
2 changes: 1 addition & 1 deletion save.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"strings"

"github.com/golang/glog"
"github.com/google/go-licenses/licenses"
"github.com/Bobgy/go-licenses/v2/licenses"
"github.com/otiai10/copy"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion testdata/modules/modinsubdir05/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
// * therefore, go-licenses finds a LICENSE file at root of submodule and tries to guess its remote URL as root of submodule, while the actual LICENSE file is at root of repo
// Note, adopting pkgsite/source allowed us to get the correct tag `storage/v1.10.0` for this repo, but we still hit this LICENSE file path problem.
//
// More context in: https://github.com/google/go-licenses/issues/73#issuecomment-1019453152
// More context in: https://github.com/Bobgy/go-licenses/v2/issues/73#issuecomment-1019453152
)

func main() {
Expand Down

0 comments on commit 29b2d5d

Please sign in to comment.