Skip to content

Commit

Permalink
Fix file open not close
Browse files Browse the repository at this point in the history
  • Loading branch information
waybackarchiver committed Mar 18, 2023
1 parent 99b6fd6 commit a0922e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/gabriel-vasile/mimetype v1.4.2
github.com/go-shiori/go-readability v0.0.0-20220215145315-dd6828d2f09b
github.com/go-shiori/obelisk v0.0.0-20221119111008-23c015a8fad7
github.com/kallydev/telegraph-go v1.0.0
github.com/kallydev/telegraph-go v1.0.1-0.20230318133700-df034d9eed50
github.com/oliamb/cutter v0.2.2
github.com/pkg/errors v0.9.1
github.com/wabarc/helper v0.0.0-20230209075818-96584f1ebf9d
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kallydev/telegraph-go v1.0.0 h1:JsIlQfYCY4S5QH20rJYSN6A1eY/vVx07oBVaCsGU/nE=
github.com/kallydev/telegraph-go v1.0.0/go.mod h1:vZj7M9HridntSIuQ7D9hgn2idKiA0T1VIblLp6l9uuc=
github.com/kallydev/telegraph-go v1.0.1-0.20230318133700-df034d9eed50 h1:Os2f/xCaCfWqMAW8hAW8uviDY8XsRqkLUgLFFldSTYw=
github.com/kallydev/telegraph-go v1.0.1-0.20230318133700-df034d9eed50/go.mod h1:vZj7M9HridntSIuQ7D9hgn2idKiA0T1VIblLp6l9uuc=
github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o=
github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
Expand Down
7 changes: 6 additions & 1 deletion ph.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ next:
return "", errors.New("data empty")
}

file, _ := os.Open(fmt.Sprint(shot.HTML))
file, err := os.Open(fmt.Sprint(shot.HTML))
if err != nil {
return "", errors.Wrap(err, "open failed")
}
defer file.Close()

article := articleFromContext(ctx)
if article.Content != "" {
goto post
Expand Down

0 comments on commit a0922e1

Please sign in to comment.