Skip to content

Commit

Permalink
Lint: Resolve lint errors
Browse files Browse the repository at this point in the history
- Return value of x not checked
  • Loading branch information
mertssmnoglu committed Feb 26, 2024
1 parent dca162a commit b30b671
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ func CmdRoot(cmd *cobra.Command, args []string) {
if versionFlag {
CmdVersion(cmd, args)
}
cmd.Help()
err := cmd.Help()
if err != nil {
panic(err)
}
}

func init() {
rootCmd.Flags().BoolVarP(&versionFlag, "version", "v", false, "Print version information and quit")
}

func Execute() {
rootCmd.Execute()
err := rootCmd.Execute()
if err != nil {
panic(err)
}
}
5 changes: 4 additions & 1 deletion internals/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ func Markdown(filePath string) func(w http.ResponseWriter, r *http.Request) {
fullHTML := fmt.Sprintf(string(html), markdownContent)

return func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(fullHTML))
_, err := w.Write([]byte(fullHTML))
if err != nil {
log.Fatal(err)
}
}
}

0 comments on commit b30b671

Please sign in to comment.