Skip to content

Commit 5365838

Browse files
committed
internal/mod/modzip: rename from internal/mod/zip
The name clash with archive/zip is annoying and lots of importers used `modzip` as an alias. `modzip` is more descriptive and removes that need. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I2ecf795ac99fd169ad542d5e726748a6f742f870 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1171760 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent b2ac3f7 commit 5365838

40 files changed

+12
-12
lines changed

cue/load/registry.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"cuelang.org/go/internal/mod/modfile"
1313
"cuelang.org/go/internal/mod/modregistry"
1414
"cuelang.org/go/internal/mod/module"
15-
"cuelang.org/go/internal/mod/zip"
15+
"cuelang.org/go/internal/mod/modzip"
1616
)
1717

1818
// registryClient implements the protocol for talking to
@@ -88,7 +88,7 @@ func (c *registryClient) getModContents(ctx context.Context, mv module.Version)
8888
if _, err := io.Copy(f, r); err != nil {
8989
return "", fmt.Errorf("cannot copy data to zip file %q: %v", zipfile, err)
9090
}
91-
if err := zip.Unzip(modPath, mv, zipfile); err != nil {
91+
if err := modzip.Unzip(modPath, mv, zipfile); err != nil {
9292
return "", fmt.Errorf("cannot unzip %v: %v", mv, err)
9393
}
9494
return modPath, nil

internal/mod/modmux/mux_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"cuelang.org/go/internal/mod/modregistry"
2222
"cuelang.org/go/internal/mod/modresolve"
2323
"cuelang.org/go/internal/mod/module"
24-
modzip "cuelang.org/go/internal/mod/zip"
24+
"cuelang.org/go/internal/mod/modzip"
2525
"cuelang.org/go/internal/registrytest"
2626
)
2727

internal/mod/modregistry/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
"cuelang.org/go/internal/mod/modfile"
3434
"cuelang.org/go/internal/mod/module"
35-
modzip "cuelang.org/go/internal/mod/zip"
35+
"cuelang.org/go/internal/mod/modzip"
3636
)
3737

3838
var ErrNotFound = fmt.Errorf("module not found")

internal/mod/modregistry/client_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"cuelabs.dev/go/oci/ociregistry/ocimem"
3131

3232
"cuelang.org/go/internal/mod/module"
33-
modzip "cuelang.org/go/internal/mod/zip"
33+
"cuelang.org/go/internal/mod/modzip"
3434
)
3535

3636
func newTestClient(t *testing.T) *Client {

internal/mod/zip/vendor_test.go internal/mod/modzip/vendor_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
package zip
5+
package modzip
66

77
import "testing"
88

internal/mod/zip/zip.go internal/mod/modzip/zip.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// Package zip provides functions for creating and extracting module zip files.
5+
// Package modzip provides functions for creating and extracting module zip files.
66
//
77
// Module zip files have several restrictions listed below. These are necessary
88
// to ensure that module zip files can be extracted consistently on supported
@@ -35,7 +35,7 @@
3535
//
3636
// Note that this package does not provide hashing functionality. See
3737
// golang.org/x/mod/sumdb/dirhash.
38-
package zip
38+
package modzip
3939

4040
import (
4141
"archive/zip"

internal/mod/zip/zip_test.go internal/mod/modzip/zip_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
package zip_test
5+
package modzip_test
66

77
import (
88
"archive/zip"
@@ -22,7 +22,7 @@ import (
2222

2323
"cuelang.org/go/internal/cuetest"
2424
"cuelang.org/go/internal/mod/module"
25-
modzip "cuelang.org/go/internal/mod/zip"
25+
"cuelang.org/go/internal/mod/modzip"
2626
"golang.org/x/mod/sumdb/dirhash"
2727
"golang.org/x/tools/txtar"
2828
)

internal/registrytest/registry.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"cuelang.org/go/internal/mod/modfile"
2424
"cuelang.org/go/internal/mod/modregistry"
2525
"cuelang.org/go/internal/mod/module"
26-
"cuelang.org/go/internal/mod/zip"
26+
"cuelang.org/go/internal/mod/modzip"
2727
)
2828

2929
// AuthConfig specifies authorization requirements for the server.
@@ -219,7 +219,7 @@ type moduleContent struct {
219219
}
220220

221221
func (c *moduleContent) writeZip(w io.Writer) error {
222-
return zip.Create[txtar.File](w, c.version, c.files, txtarFileIO{})
222+
return modzip.Create[txtar.File](w, c.version, c.files, txtarFileIO{})
223223
}
224224

225225
func (c *moduleContent) init(ctx *cue.Context, versDir string) error {

0 commit comments

Comments
 (0)