mirror of
https://github.com/github/codeql.git
synced 2026-01-29 06:12:58 +01:00
Add new style build constraints and add test for the old style
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package main
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Code generated by https://github.com/gagliardetto/codebox. DO NOT EDIT.
|
||||
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package main
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// +build linux, amd64
|
||||
//go:build (linux && ignore) || amd64
|
||||
// +build linux,ignore amd64
|
||||
|
||||
package main
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package main
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build (386 || amd64p32 || arm || armbe || mips || mipsle || mips64p32 || mips64p32le || ppc || s390 || sparc) && gc && go1.4
|
||||
// +build 386 amd64p32 arm armbe mips mipsle mips64p32 mips64p32le ppc s390 sparc
|
||||
// +build gc
|
||||
// +build go1.4
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build (amd64 || arm64 || arm64be || ppc64 || ppc64le || mips64 || mips64le || s390x || sparc64) && gc && go1.4
|
||||
// +build amd64 arm64 arm64be ppc64 ppc64le mips64 mips64le s390x sparc64
|
||||
// +build gc
|
||||
// +build go1.4
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// +build gc
|
||||
// +build go1.4
|
||||
//go:build gc && go1.4
|
||||
// +build gc,go1.4
|
||||
|
||||
package main
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// autoformat-ignore (gofmt adds new style build constraints)
|
||||
// +build amd64 arm64 arm64be ppc64 ppc64le mips64 mips64le s390x sparc64
|
||||
// +build gc
|
||||
// +build go1.4
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func oldTestIntSink64() {
|
||||
{
|
||||
parsed, err := strconv.ParseInt("3456", 10, 64)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_ = int(parsed) // OK
|
||||
_ = uint(parsed) // OK
|
||||
}
|
||||
{
|
||||
parsed, err := strconv.ParseUint("3456", 10, 64)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_ = int(parsed) // OK
|
||||
_ = uint(parsed) // OK
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user