Skip to content

Commit 99a5385

Browse files
author
Bryan C. Mills
committed
all: add missing //go:build comments
These were apparently overlooked in CL 357329, CL 294490, CL 296889, and other various updates to this module. (I noticed them via gopls while investigating golang/go#49466.) Updates golang/go#41184 Change-Id: Id042bb6fe5282e6d528e9315acf2ad29d0df58ba Reviewed-on: https://go-review.googlesource.com/c/sys/+/362577 Trust: Bryan C. Mills <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 51b60fd commit 99a5385

33 files changed

+42
-2
lines changed

plan9/mksyscall.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build ignore
56
// +build ignore
67

78
/*
@@ -49,7 +50,12 @@ func cmdLine() string {
4950
return "go run mksyscall.go " + strings.Join(os.Args[1:], " ")
5051
}
5152

52-
// buildTags returns build tags
53+
// goBuildTags returns build tags in the go:build format.
54+
func goBuildTags() string {
55+
return strings.ReplaceAll(*tags, ",", " && ")
56+
}
57+
58+
// plusBuildTags returns build tags in the +build format.
5359
func buildTags() string {
5460
return *tags
5561
}
@@ -377,12 +383,13 @@ func main() {
377383
}
378384
file.Close()
379385
}
380-
fmt.Printf(srcTemplate, cmdLine(), buildTags(), text)
386+
fmt.Printf(srcTemplate, cmdLine(), goBuildTags(), plusBuildTags(), text)
381387
}
382388

383389
const srcTemplate = `// %s
384390
// Code generated by the command above; see README.md. DO NOT EDIT.
385391
392+
//go:build %s
386393
// +build %s
387394
388395
package plan9

plan9/pwd_go15_plan9.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build go1.5
56
// +build go1.5
67

78
package plan9

plan9/pwd_plan9.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build !go1.5
56
// +build !go1.5
67

78
package plan9

plan9/race.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build plan9 && race
56
// +build plan9,race
67

78
package plan9

plan9/race0.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build plan9 && !race
56
// +build plan9,!race
67

78
package plan9

plan9/str.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build plan9
56
// +build plan9
67

78
package plan9

plan9/syscall.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build plan9
56
// +build plan9
67

78
// Package plan9 contains an interface to the low-level operating system

plan9/syscall_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build plan9
56
// +build plan9
67

78
package plan9_test

plan9/zsyscall_plan9_386.go

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

plan9/zsyscall_plan9_amd64.go

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

plan9/zsyscall_plan9_arm.go

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

unix/linux/mkall.go

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// the appropriate sources are ready, the program is run as:
1111
// go run linux/mkall.go <linux_dir> <glibc_dir>
1212

13+
//go:build ignore
1314
// +build ignore
1415

1516
package main

unix/mkmerge_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func TestMerge(t *testing.T) {
105105
106106
// build directives for arch{{.}}
107107
108+
//go:build goos && arch{{.}}
108109
// +build goos,arch{{.}}
109110
110111
package main
@@ -190,6 +191,7 @@ const (
190191
191192
// build directives for arch{{.}}
192193
194+
//go:build goos && arch{{.}}
193195
// +build goos,arch{{.}}
194196
195197
package main

windows/registry/export_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package registry

windows/registry/mksyscall.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build generate
56
// +build generate
67

78
package registry

windows/registry/registry_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package registry_test

windows/registry/syscall.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package registry

windows/registry/value.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package registry

windows/svc/debug/log.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package debug

windows/svc/debug/service.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
// Package debug provides facilities to execute svc.Handler on console.

windows/svc/eventlog/install.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package eventlog

windows/svc/eventlog/log.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
// Package eventlog implements access to Windows event log.

windows/svc/eventlog/log_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package eventlog_test

windows/svc/example/beep.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package main

windows/svc/example/install.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package main

windows/svc/example/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
// Example service program that beeps.

windows/svc/example/manage.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package main

windows/svc/example/service.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package main

windows/svc/mgr/config.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package mgr

windows/svc/mgr/mgr.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
// Package mgr can be used to manage Windows service programs.

windows/svc/mgr/mgr_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package mgr_test

windows/svc/mgr/recovery.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package mgr

windows/svc/mgr/service.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
//go:build windows
56
// +build windows
67

78
package mgr

0 commit comments

Comments
 (0)