mirror of
https://github.com/golang/go
synced 2024-11-05 23:26:18 -07:00
3e9d8e2e1b
Currently, some tests under test/fixedbugs never run: $ for d in test/fixedbugs/*.dir; do ! test -f "${d%.dir}.go" && echo "$d" done test/fixedbugs/issue15071.dir test/fixedbugs/issue15609.dir test/fixedbugs/issue29612.dir Because they missed the corresponding ".go" file, so "go run run.go" will skip them. Add missing ".go" files for those tests to make sure they will be collected and run. While at it, add another action "runindir", which does "go run ." inside the t.goDirName then check the output. Change-Id: I88000b3663a6a615d90c1cf11844ea0377403e3d Reviewed-on: https://go-review.googlesource.com/c/go/+/177798 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
25 lines
378 B
Go
25 lines
378 B
Go
// Copyright 2016 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package exp
|
|
|
|
func Exported(x int) int {
|
|
return inlined(x)
|
|
}
|
|
|
|
func inlined(x int) int {
|
|
y := 0
|
|
switch {
|
|
case x > 0:
|
|
y += 5
|
|
return 0 + y
|
|
case x < 1:
|
|
y += 6
|
|
fallthrough
|
|
default:
|
|
y += 7
|
|
return 2 + y
|
|
}
|
|
}
|