Conversation
|
@hanshal101 Wanted to thank you quickly for this! Will need to take a bit of time to review which I don't have right now, but will try and get some good comments in tonight! One quick thing, its nice that it runs in CI, however it would be good to have an easy way to run it locally during development. Maybe via using |
Signed-off-by: hanshal101 <hanshalmehta10@gmail.com>
|
Hello @davidmdm I have made the necessary changes here! |
|
|
||
| json.NewEncoder(w).Encode(&review) | ||
| if err := json.NewEncoder(w).Encode(&review); err != nil { | ||
| log.Fatalf("error in encoding: %v", err) |
There was a problem hiding this comment.
Definitely cannot be fatal. Client connections to our server can dissappear, or there can be other reasons that we might fail to write to any give http.ResponseWriter.
We definitely do not want to crash the program.
I believe we already have a logger in scope
| )) | ||
| json.NewEncoder(w).Encode(review) | ||
| if err := json.NewEncoder(w).Encode(review); err != nil { | ||
| log.Fatalf("error in encoding: %v", err) |
| func main() { | ||
| // This flight needs cross-namespace to be set in order to work and serves to test that feature. | ||
| json.NewEncoder(os.Stdout).Encode(flight.Resources{ | ||
| if err := json.NewEncoder(os.Stdout).Encode(flight.Resources{ |
There was a problem hiding this comment.
this is just testing. If it fails it will get caught in the tests.
Easier to just ignore the error explicitly:
_ = json.NewEncoder(...).Encode(...)
|
|
||
| func main() { | ||
| json.NewEncoder(os.Stdout).Encode(flight.Resources{ | ||
| if err := json.NewEncoder(os.Stdout).Encode(flight.Resources{ |
Fixes #137
Closes #137
Description
This PR adds the linting flow in the Github Actions CI.
Also here I have fixed maximum lint errors. But few of them are left, I am a bit confused on how to fix them. Consider fixing before merge.