Skip to content

Commit 42f5280

Browse files
committed
Syntaxes: Rename examples.go to bugs.go. Simplify and expand bug examples.
1 parent ec73e5d commit 42f5280

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package _αβx9
22

3-
import "net/http"
4-
53
// https://github.com/syscrusher/golang.tmbundle/issues/36#issuecomment-250866224
64
func OkayReturn(x int) (string, error) {
75
return "", nil
@@ -13,9 +11,9 @@ func BrokenNewlineReturn(name string) (string,
1311
nil
1412
}
1513

14+
// https://github.com/syscrusher/golang.tmbundle/issues/36#issuecomment-250847018
1615
type x struct{}
1716

18-
// https://github.com/syscrusher/golang.tmbundle/issues/36#issuecomment-250847018
1917
func (xx *x) OkayParam(a int) {
2018
return
2119
}
@@ -24,29 +22,30 @@ func (xx *x) BrokenParenthesesParam(a func()) {
2422
return
2523
}
2624

27-
func (xx *x) OkayBraketParam(a interface{}) {
25+
func BrokenParenthesesParam2(a func()) {
2826
return
2927
}
3028

31-
func (xx *x) BrokenBraketParam(a struct{}) {
29+
func (xx *x) OkayBracketParam(a interface{}) {
3230
return
3331
}
3432

35-
type v struct {}
36-
func (vv *v) Type() int (
37-
return 0
38-
)
33+
func (xx *x) BrokenBracketParam(a struct{}) {
34+
return
35+
}
36+
37+
func BrokenBracketParam2(a struct{}) {
38+
return
39+
}
3940

40-
type t []int
4141
// https://github.com/syscrusher/golang.tmbundle/issues/36#issuecomment-260472685
42-
func BrokenType() {
43-
type typeVars map[int]string
44-
typeVars["a"] = "a"
45-
typeVars["b"] = append(typeVars["a"], "b")
46-
47-
types := new(t)
48-
if _, ok := typeVars[v.Type]; !ok {
49-
types = append(types, v.Type)
50-
}
42+
func typeVarsOkay() {
43+
var typeVars []int
44+
typeVars = append(typeVars, 1)
5145
}
5246

47+
func typeVarsBroken() {
48+
var typeVars []int
49+
v := struct{ a int }{1}
50+
typeVars = append(typeVars, v.a)
51+
}

0 commit comments

Comments
 (0)