Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishrb committed Oct 9, 2024
1 parent 5dcde0a commit 0a29157
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ func (client *Client) Serve(file string) error {
// Serve website with rendered markdown
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
f, err := dir.Open(r.URL.Path)
if err == nil {
defer f.Close()
}
if err == nil {
defer f.Close()
}

if err == nil && regex.MatchString(r.URL.Path) {
// Open file and convert to html
Expand All @@ -57,9 +57,9 @@ func (client *Client) Serve(file string) error {
// If README.md exists then open README.md at beginning
readme := "README.md"
f, err := dir.Open(readme)
if err == nil {
defer f.Close()
}
if err == nil {
defer f.Close()
}
if err == nil && client.OpenReadme {
addr = path.Join(addr, readme)
}
Expand Down

0 comments on commit 0a29157

Please sign in to comment.