Skip to content

Commit

Permalink
cmd/go: delete internal packages moved to x/mod
Browse files Browse the repository at this point in the history
This change deletes several internal packages, replaces imports to
them with the equivalent golang.org/x/mod packages, updates x/mod, and
re-runs 'go mod vendor'.

Packages are replaced as follows:

cmd/go/internal/modfile → golang.org/x/mod/modfile
cmd/go/internal/module → golang.org/x/mod/module
cmd/go/internal/semver → golang.org/x/mod/semver
cmd/go/internal/sumdb → golang.org/x/mod/sumdb
cmd/go/internal/dirhash → golang.org/x/mod/sumdb/dirhash
cmd/go/internal/note → golang.org/x/mod/sumdb/note
cmd/go/internal/tlog → golang.org/x/mod/sumdb/tlog

Updates #31761
Fixes #34924

Change-Id: Ie3bf677bb0be49af969f654a0214243a6547eb57
Reviewed-on: https://go-review.googlesource.com/c/go/+/202698
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
  • Loading branch information
Jay Conrod committed Oct 29, 2019
1 parent cc47b0d commit 1fb7d54
Showing 104 changed files with 4,418 additions and 2,987 deletions.
3 changes: 2 additions & 1 deletion src/cmd/go.mod
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@ require (
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f
github.com/ianlancetaylor/demangle v0.0.0-20180524225900-fc6590592b44 // indirect
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
golang.org/x/mod v0.1.1-0.20191029194233-18c3998b6452
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect
golang.org/x/tools v0.0.0-20191018203202-04252eccb9d5
)
10 changes: 8 additions & 2 deletions src/cmd/go.sum
Original file line number Diff line number Diff line change
@@ -5,16 +5,22 @@ github.com/ianlancetaylor/demangle v0.0.0-20180524225900-fc6590592b44/go.mod h1:
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1 h1:A71BZbKSu+DtCNry/x5JKn20C+64DirDHmePEA8k0FY=
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.1.1-0.20191029194233-18c3998b6452 h1:ES2W0A+AqNBCkgWga22gheu9IUDjq3TDmeCdY1A7jhk=
golang.org/x/mod v0.1.1-0.20191029194233-18c3998b6452/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dzugGxJ/SQHoNufZJq1w=
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20191018203202-04252eccb9d5 h1:TFUhCYbgGMOGnRxJv+j0iAcxCjk8oGjXXWNejQBhUUs=
golang.org/x/tools v0.0.0-20191018203202-04252eccb9d5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
135 changes: 0 additions & 135 deletions src/cmd/go/internal/dirhash/hash_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion src/cmd/go/internal/get/path.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
"unicode/utf8"
)

// The following functions are copied verbatim from cmd/go/internal/module/module.go,
// The following functions are copied verbatim from golang.org/x/mod/module/module.go,
// with a change to additionally reject Windows short-names,
// and one to accept arbitrary letters (golang.org/issue/29101).
//
5 changes: 3 additions & 2 deletions src/cmd/go/internal/modcmd/download.go
Original file line number Diff line number Diff line change
@@ -5,16 +5,17 @@
package modcmd

import (
"cmd/go/internal/cfg"
"encoding/json"
"os"

"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/modfetch"
"cmd/go/internal/modload"
"cmd/go/internal/module"
"cmd/go/internal/par"
"cmd/go/internal/work"

"golang.org/x/mod/module"
)

var cmdDownload = &base.Command{
5 changes: 3 additions & 2 deletions src/cmd/go/internal/modcmd/edit.go
Original file line number Diff line number Diff line change
@@ -16,10 +16,11 @@ import (

"cmd/go/internal/base"
"cmd/go/internal/modfetch"
"cmd/go/internal/modfile"
"cmd/go/internal/modload"
"cmd/go/internal/module"
"cmd/go/internal/work"

"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
)

var cmdEdit = &base.Command{
5 changes: 3 additions & 2 deletions src/cmd/go/internal/modcmd/graph.go
Original file line number Diff line number Diff line change
@@ -8,15 +8,16 @@ package modcmd

import (
"bufio"
"cmd/go/internal/cfg"
"os"
"sort"

"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/modload"
"cmd/go/internal/module"
"cmd/go/internal/par"
"cmd/go/internal/work"

"golang.org/x/mod/module"
)

var cmdGraph = &base.Command{
3 changes: 2 additions & 1 deletion src/cmd/go/internal/modcmd/tidy.go
Original file line number Diff line number Diff line change
@@ -14,8 +14,9 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/modfetch"
"cmd/go/internal/modload"
"cmd/go/internal/module"
"cmd/go/internal/work"

"golang.org/x/mod/module"
)

var cmdTidy = &base.Command{
5 changes: 3 additions & 2 deletions src/cmd/go/internal/modcmd/vendor.go
Original file line number Diff line number Diff line change
@@ -18,9 +18,10 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/imports"
"cmd/go/internal/modload"
"cmd/go/internal/module"
"cmd/go/internal/semver"
"cmd/go/internal/work"

"golang.org/x/mod/module"
"golang.org/x/mod/semver"
)

var cmdVendor = &base.Command{
7 changes: 4 additions & 3 deletions src/cmd/go/internal/modcmd/verify.go
Original file line number Diff line number Diff line change
@@ -6,17 +6,18 @@ package modcmd

import (
"bytes"
"cmd/go/internal/cfg"
"fmt"
"io/ioutil"
"os"

"cmd/go/internal/base"
"cmd/go/internal/dirhash"
"cmd/go/internal/cfg"
"cmd/go/internal/modfetch"
"cmd/go/internal/modload"
"cmd/go/internal/module"
"cmd/go/internal/work"

"golang.org/x/mod/module"
"golang.org/x/mod/sumdb/dirhash"
)

var cmdVerify = &base.Command{
8 changes: 5 additions & 3 deletions src/cmd/go/internal/modcmd/why.go
Original file line number Diff line number Diff line change
@@ -5,12 +5,14 @@
package modcmd

import (
"fmt"
"strings"

"cmd/go/internal/base"
"cmd/go/internal/modload"
"cmd/go/internal/module"
"cmd/go/internal/work"
"fmt"
"strings"

"golang.org/x/mod/module"
)

var cmdWhy = &base.Command{
7 changes: 4 additions & 3 deletions src/cmd/go/internal/modconv/convert.go
Original file line number Diff line number Diff line change
@@ -13,10 +13,11 @@ import (

"cmd/go/internal/base"
"cmd/go/internal/modfetch"
"cmd/go/internal/modfile"
"cmd/go/internal/module"
"cmd/go/internal/par"
"cmd/go/internal/semver"

"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
"golang.org/x/mod/semver"
)

// ConvertLegacyConfig converts legacy config to modfile.
5 changes: 3 additions & 2 deletions src/cmd/go/internal/modconv/convert_test.go
Original file line number Diff line number Diff line change
@@ -19,8 +19,9 @@ import (
"cmd/go/internal/cfg"
"cmd/go/internal/modfetch"
"cmd/go/internal/modfetch/codehost"
"cmd/go/internal/modfile"
"cmd/go/internal/module"

"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
)

func TestMain(m *testing.M) {
6 changes: 3 additions & 3 deletions src/cmd/go/internal/modconv/dep.go
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@ import (
"strconv"
"strings"

"cmd/go/internal/modfile"
"cmd/go/internal/module"
"cmd/go/internal/semver"
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
"golang.org/x/mod/semver"
)

func ParseGopkgLock(file string, data []byte) (*modfile.File, error) {
4 changes: 2 additions & 2 deletions src/cmd/go/internal/modconv/glide.go
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ package modconv
import (
"strings"

"cmd/go/internal/modfile"
"cmd/go/internal/module"
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
)

func ParseGlideLock(file string, data []byte) (*modfile.File, error) {
4 changes: 2 additions & 2 deletions src/cmd/go/internal/modconv/glock.go
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ package modconv
import (
"strings"

"cmd/go/internal/modfile"
"cmd/go/internal/module"
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
)

func ParseGLOCKFILE(file string, data []byte) (*modfile.File, error) {
4 changes: 2 additions & 2 deletions src/cmd/go/internal/modconv/godeps.go
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ package modconv
import (
"encoding/json"

"cmd/go/internal/modfile"
"cmd/go/internal/module"
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
)

func ParseGodepsJSON(file string, data []byte) (*modfile.File, error) {
2 changes: 1 addition & 1 deletion src/cmd/go/internal/modconv/modconv.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

package modconv

import "cmd/go/internal/modfile"
import "golang.org/x/mod/modfile"

var Converters = map[string]func(string, []byte) (*modfile.File, error){
"GLOCKFILE": ParseGLOCKFILE,
4 changes: 2 additions & 2 deletions src/cmd/go/internal/modconv/tsv.go
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ package modconv
import (
"strings"

"cmd/go/internal/modfile"
"cmd/go/internal/module"
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
)

func ParseDependenciesTSV(file string, data []byte) (*modfile.File, error) {
Loading

0 comments on commit 1fb7d54

Please sign in to comment.