vendor: migrate from govendor to go mod vendor
The rsc.io/pdf package was added to the vendor directory 5 years ago
in CL 13968, back when the vendor directory was a part of the Go 1.5
vendor experiment.
The vendor.json file was written by hand in a format compatible with
the govendor tool. By now, that tool has been deprecated in favor of
the go command in module mode.
A go.mod file requiring a newer version of rsc.io/pdf was added in
CL 167137. Modify the vendor directory to use the newer rsc.io/pdf
version by recreating vendor directory using go command in Go 1.14:
rm -rf vendor
go mod vendor
It's possible the vendor directory isn't needed anymore and can be
safely deleted in a future change. The scope of this CL is only to
migrate from the deprecated govendor tool to the supported go tool;
deleting the vendor directory can still be done in a future change.
Remove the explicit mention of Go 1.5 vendor experiment from README
since it's old, and not relevant by now. Add a contributing section.
Updates golang/go#30228
Updates golang/go#33848
Change-Id: I95de95a3b2d81faf7235c675e5b8d425141f8d7a
Reviewed-on: https://go-review.googlesource.com/c/arch/+/222538
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/README.md b/README.md
index a7d334d..4a6ca8e 100644
--- a/README.md
+++ b/README.md
@@ -3,4 +3,11 @@
This repository holds machine architecture information used by the Go toolchain.
The parts needed in the main Go repository are copied in.
-This repository requires Go 1.5+ with the vendor experiment enabled.
+## Report Issues / Send Patches
+
+This repository uses Gerrit for code changes. To learn how to submit changes to
+this repository, see https://golang.org/doc/contribute.html.
+
+The main issue tracker for the arch repository is located at
+https://github.com/golang/go/issues. Prefix your issue with "x/arch:" in the
+subject line, so it is easy to find.
diff --git a/vendor/modules.txt b/vendor/modules.txt
new file mode 100644
index 0000000..fac1149
--- /dev/null
+++ b/vendor/modules.txt
@@ -0,0 +1,2 @@
+# rsc.io/pdf v0.1.1
+rsc.io/pdf
diff --git a/vendor/rsc.io/pdf/lex.go b/vendor/rsc.io/pdf/lex.go
index 0a7e335..ee73fd9 100644
--- a/vendor/rsc.io/pdf/lex.go
+++ b/vendor/rsc.io/pdf/lex.go
@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build go1.6
-// +build !386 go1.8
-// ... see golang.org/issue/12840
-
// Reading of PDF tokens and objects from a raw byte stream.
package pdf
diff --git a/vendor/rsc.io/pdf/page.go b/vendor/rsc.io/pdf/page.go
index 7ce5f48..77f02b1 100644
--- a/vendor/rsc.io/pdf/page.go
+++ b/vendor/rsc.io/pdf/page.go
@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build go1.6
-// +build !386 go1.8
-// ... see golang.org/issue/12840
-
package pdf
import (
@@ -50,6 +46,7 @@
num--
}
}
+ break
}
return Page{}
}
diff --git a/vendor/rsc.io/pdf/ps.go b/vendor/rsc.io/pdf/ps.go
index 8c829f0..90c551e 100644
--- a/vendor/rsc.io/pdf/ps.go
+++ b/vendor/rsc.io/pdf/ps.go
@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build go1.6
-// +build !386 go1.8
-// ... see golang.org/issue/12840
-
package pdf
import (
diff --git a/vendor/rsc.io/pdf/read.go b/vendor/rsc.io/pdf/read.go
index 4d67c14..32a7c80 100644
--- a/vendor/rsc.io/pdf/read.go
+++ b/vendor/rsc.io/pdf/read.go
@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build go1.6
-// +build !386 go1.8
-// ... see golang.org/issue/12840
-
// Package pdf implements reading of PDF files.
//
// Overview
@@ -700,7 +696,7 @@
}
// Len returns the length of the array v.
-// If v.Kind() != Array, Len returns a null Value.
+// If v.Kind() != Array, Len returns 0.
func (v Value) Len() int {
x, ok := v.data.(array)
if !ok {
@@ -759,7 +755,7 @@
def, ok := obj.(objdef)
if !ok {
panic(fmt.Errorf("loading %v: found %T instead of objdef", ptr, obj))
- return Value{}
+ //return Value{}
}
if def.ptr != ptr {
panic(fmt.Errorf("loading %v: found %v", ptr, def.ptr))
@@ -1056,7 +1052,7 @@
rd = &cbcReader{cbc: cbc, rd: rd, buf: make([]byte, 16)}
} else {
c, _ := rc4.NewCipher(key)
- rd = &cipher.StreamReader{c, rd}
+ rd = &cipher.StreamReader{S: c, R: rd}
}
return rd
}
diff --git a/vendor/vendor.json b/vendor/vendor.json
deleted file mode 100644
index dc333c0..0000000
--- a/vendor/vendor.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "package": [
- {
- "canonical": "rsc.io/pdf",
- "local": "rsc.io/pdf",
- "revision": "371ad118eb63f9f52971201c4e903420401ed37f",
- "revisionTime": "2015-07-23T06:11:39Z"
- }
- ]
-}