mirror of
https://github.com/golang/go
synced 2024-11-26 19:41:19 -07:00
864aa86448
So the bounds check which are eliminated during late fuse pass could be detected correctly. Fixes #67329 Change-Id: Id7992fbb8c26e0d43e7db66a0a3a2c0d9ed937a8 Reviewed-on: https://go-review.googlesource.com/c/go/+/598635 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
28 lines
440 B
Go
28 lines
440 B
Go
// errorcheck -0 -d=ssa/check_bce/debug=1
|
|
|
|
// Copyright 2024 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 x
|
|
|
|
func Found(x []string) string {
|
|
switch len(x) {
|
|
default:
|
|
return x[0]
|
|
case 0, 1:
|
|
return ""
|
|
}
|
|
}
|
|
|
|
func NotFound(x []string) string {
|
|
switch len(x) {
|
|
default:
|
|
return x[0]
|
|
case 0:
|
|
return ""
|
|
case 1:
|
|
return ""
|
|
}
|
|
}
|