diff --git a/go.mod b/go.mod index 9c2ce63..2eb5397 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 939bf8f..2e2541f 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/ph.go b/ph.go index f39fd7a..3869f6a 100644 --- a/ph.go +++ b/ph.go @@ -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