Each Go compiler error has an associated Markdown file which lists
an explanation of the error as well as an example of what may cause
the error. The Markdown files are generated by the generrordocs.go
tool which is located in the main Go repository
($GOROOT/src/internal/types/errors/generrordocs.go).

Change-Id: Iab699bc995e9e25c6ff048ccbb71c62905b5e899
Reviewed-on: https://go-review.googlesource.com/c/website/+/493678
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
This commit is contained in:
Carlos Amedee 2023-05-10 17:56:22 -04:00
Родитель d1f28970d1
Коммит da863783d7
146 изменённых файлов: 3014 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,22 @@
---
title: AmbiguousSelector
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
AmbiguousSelector occurs when a selector is ambiguous.
Example:
type E1 struct { i int }
type E2 struct { i int }
type T struct { E1; E2 }
var x T
var _ = x.i
```

14
_content/e/BadDecl.md Normal file
Просмотреть файл

@ -0,0 +1,14 @@
---
title: BadDecl
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
BadDecl occurs when a declaration has invalid syntax.
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: BadDotDotDotSyntax
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
BadDotDotDotSyntax occurs when a "..." occurs in a context where it is
not valid.
Example:
var _ = map[int][...]int{0: {}}
```

Просмотреть файл

@ -0,0 +1,14 @@
---
title: BadImportPath
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
BadImportPath occurs when an import path is not valid.
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: BadOffsetofSyntax
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument
that is not a selector expression.
Example:
import "unsafe"
var x int
var _ = unsafe.Offsetof(x)
```

18
_content/e/BadRecv.md Normal file
Просмотреть файл

@ -0,0 +1,18 @@
---
title: BadRecv
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
BadRecv occurs when a method declaration does not have exactly one
receiver parameter.
Example:
func () _() {}
```

Просмотреть файл

@ -0,0 +1,22 @@
---
title: BadTypeKeyword
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
BadTypeKeyword occurs when a .(type) expression is used anywhere other
than a type switch.
Example:
type I interface {
m()
}
var t I
var _ = t.(type)
```

Просмотреть файл

@ -0,0 +1,23 @@
---
title: BlankIfaceMethod
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
BlankIfaceMethod occurs when a method name is '_'.
Per the spec:
"The name of each explicitly specified method must be unique and not
blank."
Example:
type T interface {
_(int)
}
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: BlankPkgName
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
BlankPkgName occurs when a package name is the blank identifier "_".
Per the spec:
"The PackageName must not be the blank identifier."
Example:
package _
```

Просмотреть файл

@ -0,0 +1,17 @@
---
title: BrokenImport
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
BrokenImport occurs when importing a package fails.
Example:
import "amissingpackage"
```

Просмотреть файл

@ -0,0 +1,22 @@
---
title: CannotInferTypeArgs
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
CannotInferTypeArgs occurs when type or function type argument inference
fails to infer all type arguments.
Example:
func f[T any]() {}
func _() {
f()
}
```

19
_content/e/DivByZero.md Normal file
Просмотреть файл

@ -0,0 +1,19 @@
---
title: DivByZero
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
DivByZero occurs when a division operation is provable at compile
time to be a division by zero.
Example:
const divisor = 0
var x int = 1/divisor
```

Просмотреть файл

@ -0,0 +1,25 @@
---
title: DuplicateCase
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
DuplicateCase occurs when a type or expression switch has duplicate
cases.
Example:
func printInt(i int) {
switch i {
case 1:
println("one")
case 1:
println("One")
}
}
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: DuplicateDecl
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
DuplicateDecl occurs when an identifier is declared multiple times.
Example:
var x = 1
var x = 2
```

Просмотреть файл

@ -0,0 +1,27 @@
---
title: DuplicateDefault
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
DuplicateDefault occurs when a type or expression switch has multiple
default clauses.
Example:
func printInt(i int) {
switch i {
case 1:
println("one")
default:
println("One")
default:
println("1")
}
}
```

Просмотреть файл

@ -0,0 +1,22 @@
---
title: DuplicateFieldAndMethod
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
DuplicateFieldAndMethod occurs when an identifier appears as both a field
and method name.
Example:
type T struct {
m int
}
func (T) m() {}
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: DuplicateLabel
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
DuplicateLabel occurs when a label is declared more than once.
Example:
func f() int {
L:
L:
return 1
}
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: DuplicateLitField
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
DuplicateLitField occurs when a struct literal contains duplicated
fields.
Example:
var _ = struct{i int}{i: 1, i: 2}
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: DuplicateLitKey
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
DuplicateLitKey occurs when an index is duplicated in a slice, array, or
map literal.
Example:
var _ = []int{0:1, 0:2}
Example:
var _ = map[string]int{"a": 1, "a": 2}
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: DuplicateMethod
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
DuplicateMethod occurs when two methods on the same receiver type have
the same name.
Example:
type T struct {}
func (T) m() {}
func (T) m(i int) int { return i }
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: ImportCRenamed
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
ImportCRenamed occurs when the special import "C" is renamed. "C" is a
pseudo-package, and must not be renamed.
Example:
import _ "C"
```

Просмотреть файл

@ -0,0 +1,26 @@
---
title: ImpossibleAssert
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
ImpossibleAssert occurs for a type assertion x.(T) when the value x of
interface cannot have dynamic type T, due to a missing or mismatching
method on T.
Example:
type T int
func (t *T) m() int { return int(*t) }
type I interface { m() int }
var x I
var _ = x.(T)
```

Просмотреть файл

@ -0,0 +1,24 @@
---
title: IncomparableMapKey
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
IncomparableMapKey occurs when a map key type does not support the == and
!= operators.
Per the spec:
"The comparison operators == and != must be fully defined for operands of
the key type; thus the key type must not be a function, map, or slice."
Example:
var x map[T]int
type T []int
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: IncompatibleAssign
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
IncompatibleAssign occurs when the type of the right-hand side expression
in an assignment cannot be assigned to the type of the variable being
assigned.
Example:
var x []int
var _ int = x
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidAppend
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidAppend occurs when append is called with a first argument that is
not a slice.
Example:
var _ = append(1, 2)
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidArrayLen
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidArrayLen occurs when an array length is not a constant value.
Example:
var n = 3
var _ = [n]int{}
```

Просмотреть файл

@ -0,0 +1,19 @@
---
title: InvalidAssert
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidAssert occurs when a type assertion is applied to a
value that is not of interface type.
Example:
var x = 1
var _ = x.(float64)
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidBlank
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidBlank occurs when a blank identifier is used as a value or type.
Per the spec:
"The blank identifier may appear as an operand only on the left-hand side
of an assignment."
Example:
var x = _
```

19
_content/e/InvalidCall.md Normal file
Просмотреть файл

@ -0,0 +1,19 @@
---
title: InvalidCall
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidCall occurs when an expression is called that is not of function
type.
Example:
var x = "x"
var y = x()
```

22
_content/e/InvalidCap.md Normal file
Просмотреть файл

@ -0,0 +1,22 @@
---
title: InvalidCap
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidCap occurs when an argument to the cap built-in function is not of
supported type.
See https://golang.org/ref/spec#Length_and_capacity for information on
which underlying types are supported as arguments to cap and len.
Example:
var s = 2
var x = cap(s)
```

Просмотреть файл

@ -0,0 +1,27 @@
---
title: InvalidChanAssign
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidChanAssign occurs when a chan assignment is invalid.
Per the spec, a value x is assignable to a channel type T if:
"x is a bidirectional channel value, T is a channel type, x's type V and
T have identical element types, and at least one of V or T is not a
defined type."
Example:
type T1 chan int
type T2 chan int
var x T1
// Invalid assignment because both types are named
var _ T2 = x
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidClear
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidClear occurs when clear is called with an argument
that is not of map or slice type.
Example:
func _(x int) {
clear(x)
}
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidClose
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidClose occurs when close(...) is called with an argument that is
not of channel type, or that is a receive-only channel.
Example:
func f() {
var x int
close(x)
}
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidComplex
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidComplex occurs when the complex built-in function is called with
arguments with incompatible types.
Example:
var _ = complex(float32(1), float64(2))
```

21
_content/e/InvalidCond.md Normal file
Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidCond
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidCond occurs when an if condition is not a boolean expression.
Example:
func checkReturn(i int) {
if i {
panic("non-zero return")
}
}
```

Просмотреть файл

@ -0,0 +1,19 @@
---
title: InvalidConstInit
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidConstInit occurs when a const declaration has a non-constant
initializer.
Example:
var x int
const _ = x
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidConstType
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidConstType occurs when the underlying type in a const declaration
is not a valid constant type.
Example:
const c *int = 4
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidConstVal
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidConstVal occurs when a const value cannot be converted to its
target type.
TODO(findleyr): this error code and example are not very clear. Consider
removing it.
Example:
const _ = 1 {{raw "<"}}{{raw "<"}} "hello"
```

Просмотреть файл

@ -0,0 +1,22 @@
---
title: InvalidConversion
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidConversion occurs when the argument type cannot be converted to the
target.
See https://golang.org/ref/spec#Conversions for the rules of
convertibility.
Example:
var x float64
var _ = string(x)
```

25
_content/e/InvalidCopy.md Normal file
Просмотреть файл

@ -0,0 +1,25 @@
---
title: InvalidCopy
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidCopy occurs when the arguments are not of slice type or do not
have compatible type.
See https://golang.org/ref/spec#Appending_and_copying_slices for more
information on the type requirements for the copy built-in.
Example:
func f() {
var x []int
y := []int64{1,2,3}
copy(x, y)
}
```

Просмотреть файл

@ -0,0 +1,19 @@
---
title: InvalidDeclCycle
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidDeclCycle occurs when a declaration cycle is not valid.
Example:
type S struct {
S
}
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidDefer
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidDefer occurs when a deferred expression is not a function call,
for example if the expression is a type conversion.
Example:
func f(i int) int {
defer int32(i)
return i
}
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidDelete
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidDelete occurs when the delete built-in function is called with a
first argument that is not a map.
Example:
func f() {
m := "hello"
delete(m, "e")
}
```

Просмотреть файл

@ -0,0 +1,19 @@
---
title: InvalidDotDotDot
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in
function.
Example:
var s = []int{1, 2, 3}
var l = len(s...)
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidExprSwitch
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidExprSwitch occurs when a switch expression is not comparable.
Example:
func _() {
var a struct{ _ func() }
switch a /* ERROR cannot switch on a */ {
}
}
```

21
_content/e/InvalidGo.md Normal file
Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidGo
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidGo occurs when a go expression is not a function call, for example
if the expression is a type conversion.
Example:
func f(i int) int {
go int32(i)
return i
}
```

Просмотреть файл

@ -0,0 +1,24 @@
---
title: InvalidIfaceAssign
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidIfaceAssign occurs when a value of type T is used as an
interface, but T does not implement a method of the expected interface.
Example:
type I interface {
f()
}
type T int
var x I = T(1)
```

18
_content/e/InvalidImag.md Normal file
Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidImag
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidImag occurs when the imag built-in function is called with an
argument that does not have complex type.
Example:
var _ = imag(int(1))
```

Просмотреть файл

@ -0,0 +1,28 @@
---
title: InvalidIndex
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidIndex occurs when an index argument is not of integer type,
negative, or out-of-bounds.
Example:
var s = [...]int{1,2,3}
var x = s[5]
Example:
var s = []int{1,2,3}
var _ = s[-1]
Example:
var s = []int{1,2,3}
var i string
var _ = s[i]
```

Просмотреть файл

@ -0,0 +1,19 @@
---
title: InvalidIndirection
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidIndirection occurs when a non-pointer value is indirected via the
'*' operator.
Example:
var x int
var y = *x
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidInitCycle
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidInitCycle occurs when an invalid cycle is detected within the
initialization graph.
Example:
var x int = f()
func f() int { return x }
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidInitDecl
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidInitDecl occurs when init is declared as anything other than a
function.
Example:
var init = 1
Example:
func init() int { return 1 }
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidInitSig
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidInitSig occurs when an init function declares parameters or
results.
Deprecated: no longer emitted by the type checker. _InvalidInitDecl is
used instead.
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidInstanceCycle
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidInstanceCycle occurs when an invalid cycle is detected
within the instantiation graph.
Example:
func f[T any]() { f[*T]() }
```

18
_content/e/InvalidIota.md Normal file
Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidIota
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidIota occurs when the predeclared identifier iota is used outside
of a constant declaration.
Example:
var x = iota
```

Просмотреть файл

@ -0,0 +1,22 @@
---
title: InvalidIterVar
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidIterVar occurs when two iteration variables are used while ranging
over a channel.
Example:
func f(c chan int) {
for k, v := range c {
println(k, v)
}
}
```

22
_content/e/InvalidLen.md Normal file
Просмотреть файл

@ -0,0 +1,22 @@
---
title: InvalidLen
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidLen occurs when an argument to the len built-in function is not of
supported type.
See https://golang.org/ref/spec#Length_and_capacity for information on
which underlying types are supported as arguments to cap and len.
Example:
var s = 2
var x = len(s)
```

21
_content/e/InvalidLit.md Normal file
Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidLit
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidLit occurs when a composite literal expression does not match its
type.
Example:
type P *struct{
x int
}
var _ = P {}
```

Просмотреть файл

@ -0,0 +1,17 @@
---
title: InvalidLitField
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidLitField occurs when a field name is not a valid identifier.
Example:
var _ = struct{i int}{1: 1}
```

Просмотреть файл

@ -0,0 +1,19 @@
---
title: InvalidLitIndex
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidLitIndex occurs when the key in a key-value element of a slice or
array literal is not an integer constant.
Example:
var i = 0
var x = []string{i: "world"}
```

Просмотреть файл

@ -0,0 +1,15 @@
---
title: InvalidMainDecl
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidMainDecl occurs when main is declared as anything other than a
function, in a main package.
```

20
_content/e/InvalidMake.md Normal file
Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidMake
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidMake occurs when make is called with an unsupported type argument.
See https://golang.org/ref/spec#Making_slices_maps_and_channels for
information on the types that may be created using make.
Example:
var x = make(int)
```

Просмотреть файл

@ -0,0 +1,22 @@
---
title: InvalidMethodExpr
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidMethodExpr occurs when a pointer method is called but the argument
is not addressable.
Example:
type T struct {}
func (*T) m() int { return 1 }
var _ = T.m(T{})
```

Просмотреть файл

@ -0,0 +1,16 @@
---
title: InvalidMethodTypeParams
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidMethodTypeParams occurs when methods have type parameters.
It cannot be encountered with an AST parsed using go/parser.
```

Просмотреть файл

@ -0,0 +1,39 @@
---
title: InvalidOffsetof
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidOffsetof occurs when unsafe.Offsetof is called with a method
selector, rather than a field selector, or when the field is embedded via
a pointer.
Per the spec:
"If f is an embedded field, it must be reachable without pointer
indirections through fields of the struct. "
Example:
import "unsafe"
type T struct { f int }
type S struct { *T }
var s S
var _ = unsafe.Offsetof(s.f)
Example:
import "unsafe"
type S struct{}
func (S) m() {}
var s S
var _ = unsafe.Offsetof(s.m)
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidPkgUse
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidPkgUse occurs when a package identifier is used outside of a
selector expression.
Example:
import "fmt"
var _ = fmt
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidPostDecl
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidPostDecl occurs when there is a declaration in a for-loop post
statement.
Example:
func f() {
for i := 0; i {{raw "<"}} 10; j := 0 {}
}
```

Просмотреть файл

@ -0,0 +1,26 @@
---
title: InvalidPtrEmbed
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidPtrEmbed occurs when an embedded field is of the pointer form *T,
and T itself is itself a pointer, an unsafe.Pointer, or an interface.
Per the spec:
"An embedded field must be specified as a type name T or as a pointer to
a non-interface type name *T, and T itself may not be a pointer type."
Example:
type T *int
type S struct {
*T
}
```

Просмотреть файл

@ -0,0 +1,22 @@
---
title: InvalidRangeExpr
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidRangeExpr occurs when the type of a range expression is not array,
slice, string, map, or channel.
Example:
func f(i int) {
for j := range i {
println(j)
}
}
```

18
_content/e/InvalidReal.md Normal file
Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidReal
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidReal occurs when the real built-in function is called with an
argument that does not have complex type.
Example:
var _ = real(int(1))
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidReceive
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidReceive occurs when there is a channel receive from a value that
is either not a channel, or is a send-only channel.
Example:
func f() {
var x = 1
{{raw "<"}}-x
}
```

20
_content/e/InvalidRecv.md Normal file
Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidRecv
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidRecv occurs when a receiver type expression is not of the form T
or *T, or T is a pointer type.
Example:
type T struct {}
func (**T) m() {}
```

Просмотреть файл

@ -0,0 +1,25 @@
---
title: InvalidSelectCase
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidSelectCase occurs when a select case is not a channel send or
receive.
Example:
func checkChan(c {{raw "<"}}-chan int) bool {
select {
case c:
return true
default:
return false
}
}
```

21
_content/e/InvalidSend.md Normal file
Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidSend
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidSend occurs when there is a channel send to a value that is not a
channel, or is a receive-only channel.
Example:
func f() {
var x = 1
x {{raw "<"}}- "hello!"
}
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: InvalidShiftCount
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidShiftCount occurs when the right-hand side of a shift operation is
either non-integer, negative, or too large.
Example:
var (
x string
y int = 1 {{raw "<"}}{{raw "<"}} x
)
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidShiftOperand
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidShiftOperand occurs when the shifted operand is not an integer.
Example:
var s = "hello"
var x = s {{raw "<"}}{{raw "<"}} 2
```

Просмотреть файл

@ -0,0 +1,19 @@
---
title: InvalidSliceExpr
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidSliceExpr occurs when a three-index slice expression (a[x:y:z]) is
applied to a string.
Example:
var s = "hello"
var x = s[1:2:3]
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: InvalidStructLit
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidStructLit occurs when a positional struct literal has an incorrect
number of values.
Example:
var _ = struct{i, j int}{1,2,3}
```

Просмотреть файл

@ -0,0 +1,15 @@
---
title: InvalidSyntaxTree
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidSyntaxTree occurs if an invalid syntax tree is provided
to the type checker. It should never happen.
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidTypeArg
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidTypeArg occurs when a type argument does not satisfy its
corresponding type parameter constraints.
Example:
type T[P ~int] struct{}
var _ T[string]
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidTypeCycle
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidTypeCycle occurs when a cycle in type definitions results in a
type that is not well-defined.
Example:
import "unsafe"
type T [unsafe.Sizeof(T{})]int
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidTypeSwitch
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidTypeSwitch occurs when .(type) is used on an expression that is
not of interface type.
Example:
func f(i int) {
switch x := i.(type) {}
}
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: InvalidUnion
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidUnion occurs when an embedded union or approximation element is
not valid.
Example:
type _ interface {
~int | interface{ m() }
}
```

Просмотреть файл

@ -0,0 +1,23 @@
---
title: InvalidUnsafeAdd
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidUnsafeAdd occurs when unsafe.Add is called with a
length argument that is not of integer type.
It also occurs if it is used in a package compiled for a
language version before go1.17.
Example:
import "unsafe"
var p unsafe.Pointer
var _ = unsafe.Add(p, float64(1))
```

Просмотреть файл

@ -0,0 +1,42 @@
---
title: InvalidUnsafeSlice
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidUnsafeSlice occurs when unsafe.Slice is called with a
pointer argument that is not of pointer type or a length argument
that is not of integer type, negative, or out of bounds.
It also occurs if it is used in a package compiled for a language
version before go1.17.
Example:
import "unsafe"
var x int
var _ = unsafe.Slice(x, 1)
Example:
import "unsafe"
var x int
var _ = unsafe.Slice(&x, float64(1))
Example:
import "unsafe"
var x int
var _ = unsafe.Slice(&x, -1)
Example:
import "unsafe"
var x int
var _ = unsafe.Slice(&x, uint64(1) {{raw "<"}}{{raw "<"}} 63)
```

Просмотреть файл

@ -0,0 +1,22 @@
---
title: InvalidUnsafeSliceData
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidUnsafeSliceData occurs when unsafe.SliceData is called with
an argument that is not of slice type. It also occurs if it is used
in a package compiled for a language version before go1.20.
Example:
import "unsafe"
var x int
var _ = unsafe.SliceData(x)
```

Просмотреть файл

@ -0,0 +1,23 @@
---
title: InvalidUnsafeString
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidUnsafeString occurs when unsafe.String is called with
a length argument that is not of integer type, negative, or
out of bounds. It also occurs if it is used in a package
compiled for a language version before go1.20.
Example:
import "unsafe"
var b [10]byte
var _ = unsafe.String(&b[0], -1)
```

Просмотреть файл

@ -0,0 +1,19 @@
---
title: InvalidUntypedConversion
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidUntypedConversion occurs when there is no valid implicit
conversion from an untyped value satisfying the type constraints of the
context in which it is used.
Example:
var _ = 1 + []int{}
```

Просмотреть файл

@ -0,0 +1,24 @@
---
title: JumpIntoBlock
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
JumpIntoBlock occurs when a forward jump goes to a label inside a nested
block.
Example:
func f(x int) {
goto L
if x > 0 {
L:
print("inside block")
}
}
```

Просмотреть файл

@ -0,0 +1,23 @@
---
title: JumpOverDecl
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
JumpOverDecl occurs when a label jumps over a variable declaration.
Example:
func f() int {
goto L
x := 2
L:
x++
return x
}
```

Просмотреть файл

@ -0,0 +1,15 @@
---
title: MismatchedPkgName
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MismatchedPkgName occurs when a file's package name doesn't match the
package name already established by other files.
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: MismatchedTypes
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MismatchedTypes occurs when operand types are incompatible in a binary
operation.
Example:
var a = "hello"
var b = 1
var c = a - b
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: MisplacedBreak
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MisplacedBreak occurs when a break statement is not within a for, switch,
or select statement of the innermost function definition.
Example:
func f() {
break
}
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: MisplacedConstraintIface
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MisplacedConstraintIface occurs when a constraint-type interface is used
outside of constraint position.
Example:
type I interface { ~int }
var _ I
```

Просмотреть файл

@ -0,0 +1,30 @@
---
title: MisplacedContinue
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MisplacedContinue occurs when a continue statement is not within a for
loop of the innermost function definition.
Example:
func sumeven(n int) int {
proceed := func() {
continue
}
sum := 0
for i := 1; i {{raw "<"}}= n; i++ {
if i % 2 != 0 {
proceed()
}
sum += i
}
return sum
}
```

Просмотреть файл

@ -0,0 +1,18 @@
---
title: MisplacedDotDotDot
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MisplacedDotDotDot occurs when a "..." is used somewhere other than the
final argument in a function declaration.
Example:
func f(...int, int)
```

Просмотреть файл

@ -0,0 +1,26 @@
---
title: MisplacedFallthrough
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MisplacedFallthrough occurs when a fallthrough statement is not within an
expression switch.
Example:
func typename(i interface{}) string {
switch i.(type) {
case int64:
fallthrough
case int:
return "int"
}
return "unsupported"
}
```

Просмотреть файл

@ -0,0 +1,27 @@
---
title: MisplacedLabel
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MisplacedLabel occurs when a break or continue label is not on a for,
switch, or select statement.
Example:
func f() {
L:
a := []int{1,2,3}
for _, e := range a {
if e > 10 {
break L
}
println(a)
}
}
```

Просмотреть файл

@ -0,0 +1,21 @@
---
title: MisplacedTypeParam
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MisplacedTypeParam occurs when a type parameter is used in a place where
it is not permitted.
Example:
type T[P any] P
Example:
type T[P any] struct{ *P }
```

Просмотреть файл

@ -0,0 +1,20 @@
---
title: MissingFieldOrMethod
layout: article
---
<!-- Copyright 2023 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. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
MissingFieldOrMethod occurs when a selector references a field or method
that does not exist.
Example:
type T struct {}
var x = T{}.f
```

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше