Skip to content

Commit b1379a7

Browse files
committed
gen.go: update due to changes to core
Updates documentation and other changes not related to a Unicode upgrade to minimize the diff. This CL also updates gen.go to no longer copy packages into the vendor directory. Henceforth, go mod vendor should be used to copy packages. Updates golang/go#27945 Change-Id: I59da1c56e81bec67979ce13d89af3a753d4809aa Reviewed-on: https://go-review.googlesource.com/c/text/+/169637 Run-TryBot: Marcel van Lohuizen <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Russ Cox <[email protected]>
1 parent c942b20 commit b1379a7

File tree

6 files changed

+82
-82
lines changed

6 files changed

+82
-82
lines changed

encoding/internal/identifier/gen.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ func main() {
109109
use = use || a.Value != "person"
110110
}
111111
if a.Name.Local == "data" && use {
112-
attr = a.Value + " "
112+
// Patch up URLs to use https. From some links, the
113+
// https version is different from the http one.
114+
s := a.Value
115+
s = strings.Replace(s, "http://", "https://", -1)
116+
s = strings.Replace(s, "/unicode/", "/", -1)
117+
attr = s + " "
113118
}
114119
}
115120
}

encoding/internal/identifier/mib.go

+46-48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen.go

-31
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"bytes"
1313
"flag"
1414
"fmt"
15-
"go/build"
1615
"go/format"
1716
"io/ioutil"
1817
"os"
@@ -139,10 +138,6 @@ pkg unicode, var <new script or property> *RangeTable
139138
// Copy exported packages to the destination golang.org repo.
140139
copyExported("golang.org/x/net/idna")
141140

142-
if updateCore {
143-
copyInternal()
144-
}
145-
146141
if hasErrors {
147142
fmt.Println("FAIL")
148143
os.Exit(1)
@@ -242,32 +237,6 @@ func copyExported(p string) {
242237
p)
243238
}
244239

245-
// copyInternal copies packages used by Go core into the internal directory.
246-
func copyInternal() {
247-
root := filepath.Join(build.Default.GOROOT, filepath.FromSlash("src/internal/x"))
248-
249-
err := filepath.Walk(root, func(dir string, info os.FileInfo, err error) error {
250-
if err != nil || !info.IsDir() || root == dir {
251-
return err
252-
}
253-
src := dir[len(root)+1:]
254-
const slash = string(filepath.Separator)
255-
if c := strings.Split(src, slash); c[0] == "text" {
256-
// Copy a text repo package from its normal location.
257-
src = strings.Join(c[1:], slash)
258-
} else {
259-
// Copy the vendored package if it exists in the export directory.
260-
src = filepath.Join("internal", "export", filepath.Base(src))
261-
}
262-
copyPackage(src, dir, "golang.org", "internal")
263-
return nil
264-
})
265-
if err != nil {
266-
fmt.Printf("Seeding directory %s has failed %v:", root, err)
267-
os.Exit(1)
268-
}
269-
}
270-
271240
// goGenRE is used to remove go:generate lines.
272241
var goGenRE = regexp.MustCompile("//go:generate[^\n]*\n")
273242

internal/gen/gen.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ func CLDRVersion() string {
8585

8686
var tags = []struct{ version, buildTags string }{
8787
{"9.0.0", "!go1.10"},
88-
{"10.0.0", "go1.10, !go1.13"},
89-
{"11.0.0", "go1.13"},
88+
{"10.0.0", "go1.10"},
89+
// TODO
90+
// {"10.0.0", "go1.10,!go1.13"},
91+
// {"11.0.0", "go1.13"},
9092
}
9193

9294
// buildTags reports the build tags used for the current Unicode version.

0 commit comments

Comments
 (0)