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
Has this idea, or one like it, been proposed before?
Does this affect error handling?
Is this about generics?
Is this change backward compatible? Breaking the Go 1 compatibility guarantee is a large cost and requires a large benefit
Has this idea, or one like it, been proposed before?
No
Does this affect error handling?
No
Is this about generics?
No
Proposal
Recently debugging a logic more complex data processing related code,the large amount of data and complex structure make it difficult to debug breakpoints
If possible,propose to add a new feature:
Add a new keyword 'watch'(or '@','#','$'...), when the variable value specified by 'watch' changes, a code segment is automatically executed,work with the breakpoints or 'runtime.Stack' to locate specific code locations where particular data appears.
This can facilitate debugging of some logically complex code, or list outliers in advance when writing code, and find problems in time during writing.
for example:
type Data struct{
Age int
}
func F1(d *Data){
d.Age = -1
}
func F2(d *Data){
d.Age = 201
}
func aaa () error {
data := Data{}
watch data.Age {
if data.Age < 0 {
fmt.Println(stack())
return errors.New(fmt.Sprint("unexpected value",data.Age))
}
if data.Age == 201 {
fmt.Println(stack())
}
....
}
data.Age = 2
......
data.F1(&data)
......
data.F2(&data)
......
return nil
}
for frequent data changes, this new feature may only be suitable for code development、BUG debugging and other scenarios;
but it seems to handle errors pretty well, although I like 'if err != nil' very much
for example:
Go Programming Experience
Intermediate
Other Languages Experience
c/c++
Related Idea
Has this idea, or one like it, been proposed before?
No
Does this affect error handling?
No
Is this about generics?
No
Proposal
Recently debugging a logic more complex data processing related code,the large amount of data and complex structure make it difficult to debug breakpoints
If possible,propose to add a new feature:
Add a new keyword 'watch'(or '@','#','$'...), when the variable value specified by 'watch' changes, a code segment is automatically executed,work with the breakpoints or 'runtime.Stack' to locate specific code locations where particular data appears.
This can facilitate debugging of some logically complex code, or list outliers in advance when writing code, and find problems in time during writing.
for example:
for frequent data changes, this new feature may only be suitable for code development、BUG debugging and other scenarios;
but it seems to handle errors pretty well, although I like 'if err != nil' very much
for example:
Language Spec Changes
No response
Informal Change
No response
Is this change backward compatible?
Yes
Orthogonality: How does this change interact or overlap with existing features?
No response
Would this change make Go easier or harder to learn, and why?
No response
Cost Description
No response
Changes to Go ToolChain
No response
Performance Costs
No response
Prototype
No response
The text was updated successfully, but these errors were encountered: