Define supported job type names as constants and use them in all places, instead of string literals. There are multiple benefits of this approach. Using constants removed the room for typos in the string literals. One can use autocompletion in IDE for job types. Using constant makes it easier to find all references where it is used and thus all places that are handling a specific job type. |
||
|---|---|---|
| .. | ||
| api | ||
| server.go | ||
| server_internal_test.go | ||
| server_test.go | ||