You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use golang eight years.Today I want create a object.I run the code but I got error.
obj1:={
attributeName1 int
attributeName2 int
AttributeName2 int
init:=func(){
}
Func1:=func()int {
return 33
}
Func2:=func()int {
obj3.func1()
return 3243
}
length float32
go Func1()
obj3:={
kkk int
aaa int
jjj int
init:=func(){
}
func1:=func(){
}
run:=func(){
}
}
obj3.run()
}
I run it but I got error:
.\RangeTree.go:3:1: syntax error: non-declaration statement outside function body
.\RangeTree.go:7:14: method has no receiver
.\RangeTree.go:7:14: syntax error: unexpected {, expected name
.\RangeTree.go:10:2: syntax error: non-declaration statement outside function body
.\RangeTree.go:10:15: method has no receiver
.\RangeTree.go:11:3: syntax error: unexpected return, expected )
.\RangeTree.go:17:2: syntax error: non-declaration statement outside function body
.\RangeTree.go:23:15: method has no receiver
.\RangeTree.go:23:15: syntax error: unexpected {, expected name
.\RangeTree.go:26:3: syntax error: non-declaration statement outside function body
.\RangeTree.go:26:3: too many errors
I want it no error.
I just want one instance. so didn't need class define.
I want the object have one init func. that initialize the object at define.
I want the object define context can run none define code at object create.eg: obj3.run().
The text was updated successfully, but these errors were encountered:
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
I use golang eight years.Today I want create a object.I run the code but I got error.
obj1:={
attributeName1 int
attributeName2 int
AttributeName2 int
init:=func(){
}
I run it but I got error:
.\RangeTree.go:3:1: syntax error: non-declaration statement outside function body
.\RangeTree.go:7:14: method has no receiver
.\RangeTree.go:7:14: syntax error: unexpected {, expected name
.\RangeTree.go:10:2: syntax error: non-declaration statement outside function body
.\RangeTree.go:10:15: method has no receiver
.\RangeTree.go:11:3: syntax error: unexpected return, expected )
.\RangeTree.go:17:2: syntax error: non-declaration statement outside function body
.\RangeTree.go:23:15: method has no receiver
.\RangeTree.go:23:15: syntax error: unexpected {, expected name
.\RangeTree.go:26:3: syntax error: non-declaration statement outside function body
.\RangeTree.go:26:3: too many errors
I want it no error.
I just want one instance. so didn't need class define.
I want the object have one init func. that initialize the object at define.
I want the object define context can run none define code at object create.eg: obj3.run().
The text was updated successfully, but these errors were encountered: