Proposal: autocomplete also by constant values

Working with a http package, there is a method of ResponseWriter WriteHeader.

It accepts int, but due to http package has constants with http statuses, it's semantically easier to pass constants, and it also increases readability.

Sometimes it's difficult to remember what is the name of status code, so you need to google status name by it's code and then pass the constant by autocomplete of status name.

The basic idea:

Add ability to autocomplete by constant values, for example 204 No Content, will be something like this:

w.WriteHeader(http.Status204

Or even better, passing this:

w.WriteHeader(http.204

That will be autocompleted to:

w.WriteHeader(http.StatusNoContent)

 

There are also many other cases that can help with such autocomplete feature.

Thanks for your attention!

 

 

 

1
1 comment

Sounds interesting. Filed the feature request here: https://youtrack.jetbrains.com/issue/GO-7024

1

Please sign in to leave a comment.