- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 4,191 for switchn (0.29 sec)
-
test/fixedbugs/issue20185.go
// Issue 20185: type switching on untyped values (e.g. nil or consts) // caused an internal compiler error. package p func F() { switch t := nil.(type) { // ERROR "cannot type switch on non-interface value|not an interface" default: _ = t } } const x = 1 func G() { switch t := x.(type) { // ERROR "cannot type switch on non-interface value|declared and not used|not an interface"
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 27 21:10:19 UTC 2022 - 581 bytes - Viewed (0) -
src/cmd/go/internal/gover/toolchain.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Nov 06 23:20:32 UTC 2023 - 3K bytes - Viewed (0) -
src/cmd/go/testdata/script/work_goline_order.txt
# Using an old Go version, fails during module loading, but we rewrite the error to the # same one a switching version would use, without the auto-switch. # This is a misconfigured system that should not arise in practice. env TESTGO_VERSION=go1.21.1 env TESTGO_VERSION_SWITCH=switch cp go.work go.work.orig ! go list
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Jun 03 21:13:11 UTC 2023 - 977 bytes - Viewed (0) -
test/fixedbugs/issue19977.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Issue 19977: multiple error messages when type switching on an undefined package foo func Foo() { switch x := a.(type) { // ERROR "undefined: a|reference to undefined name .*a" default: _ = x }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 14 17:37:52 UTC 2020 - 381 bytes - Viewed (0) -
src/cmd/compile/internal/test/switch_test.go
rng = rng.next(predictable) switch a[rng.value()&7].(type) { case SI0: n += 1 case SI1: n += 2 case SI2: n += 3 case SI3: n += 4 case SI4: n += 5 case SI5: n += 6 case SI6: n += 7 case SI7: n += 8 } } sink = n } // A simple random number generator used to make switches conditionally predictable. type rng uint64
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 06 15:42:30 UTC 2023 - 4.2K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/ifaceassert/ifaceassert.go
targets []ast.Expr // interfaces T in v.(T) ) switch n := n.(type) { case *ast.TypeAssertExpr: // take care of v.(type) in *ast.TypeSwitchStmt if n.Type == nil { return } assert = n targets = append(targets, n.Type) case *ast.TypeSwitchStmt: // retrieve type assertion from type switch's 'assign' field switch t := n.Assign.(type) { case *ast.ExprStmt:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 2.8K bytes - Viewed (0) -
src/cmd/go/internal/modcmd/download.go
if haveExplicitArgs || modload.WorkFilePath() != "" { var sw toolchain.Switcher // Add errors to the Switcher in deterministic order so that they will be // logged deterministically. for _, m := range mods { if erri, ok := downloadErrs.Load(m); ok { sw.Error(erri.(error)) } } // Only call sw.Switch if it will actually switch. // Otherwise, we may want to write the errors as JSON
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Nov 08 19:32:39 UTC 2023 - 13.5K bytes - Viewed (0) -
src/cmd/go/testdata/script/gotoolchain_modcmds.txt
env TESTGO_VERSION=go1.21.0 env TESTGO_VERSION_SWITCH=switch # If the main module's go.mod file lists a version lower than the version # required by its dependencies, the commands that fetch and diagnose the module # graph (such as 'go mod graph' and 'go mod verify') should fail explicitly: # they can't interpret the graph themselves, and they aren't allowed to update # the go.mod file to record a specific, stable toolchain version that can. ! go mod verify
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Nov 08 19:32:39 UTC 2023 - 1.3K bytes - Viewed (0) -
src/cmd/compile/internal/ir/fmt.go
OIF: -1, OLABEL: -1, OGO: -1, ORANGE: -1, ORETURN: -1, OSELECT: -1, OSWITCH: -1, OEND: 0, } // StmtWithInit reports whether op is a statement with an explicit init list. func StmtWithInit(op Op) bool { switch op { case OIF, OFOR, OSWITCH: return true } return false } func stmtFmt(n Node, s fmt.State) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 05 15:20:28 UTC 2023 - 26K bytes - Viewed (0) -
src/runtime/asm_wasm.s
// if g == g0 call badmcall Get g Get R2 I64Eq If JMP runtime·badmcall(SB) End // switch to g0's stack I64Load (g_sched+gobuf_sp)(R2) I64Const $8 I64Sub I32WrapI64 Set SP // set arg to current g MOVD g, 0(SP) // switch to g0 MOVD R2, g // call fn Get CTXT I32WrapI64 I64Load $0 CALL Get SP I32Const $8 I32Add
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Nov 20 21:26:51 UTC 2023 - 11.8K bytes - Viewed (0)