clean up a bit

This commit is contained in:
Aaron Bieber 2022-01-31 17:18:48 -07:00
parent f02dc77b46
commit 107278bcd4
4 changed files with 43 additions and 13 deletions

View File

@ -1,6 +1,6 @@
# [gqrss](https://github.com/qbit/gqrss) # [gqrss](https://github.com/qbit/gqrss)
A tool to query and display GitHub issues relating to OpenBSD. A tool to query and display GitHub issues relating to anything you want.
## Libraries used ## Libraries used

9
go.mod
View File

@ -1,8 +1,13 @@
module suah.dev/gqrss module suah.dev/gqrss
go 1.15 go 1.17
require ( require (
github.com/gorilla/feeds v1.1.1 github.com/gorilla/feeds v1.1.1
suah.dev/protect v1.0.0 suah.dev/protect v1.2.0
)
require (
github.com/kr/pretty v0.3.0 // indirect
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 // indirect
) )

20
go.sum
View File

@ -1,6 +1,18 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/gorilla/feeds v1.1.1 h1:HwKXxqzcRNg9to+BbvJog4+f3s/xzvtZXICcQGutYfY= github.com/gorilla/feeds v1.1.1 h1:HwKXxqzcRNg9to+BbvJog4+f3s/xzvtZXICcQGutYfY=
github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA= github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA=
golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3 h1:5B6i6EAiSYyejWfvc5Rc9BbI3rzIsrrXfAQBWnYfn+w= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
suah.dev/protect v1.0.0 h1:X8pzDvDIZIiugmkmr6DES6JFO1XUdJWi34Ffmk6CMZY= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
suah.dev/protect v1.0.0/go.mod h1:ZSgyBM30JUwhVPWJzVHh0jlu5W6Qz1VR6tIhAzqJZ9Y= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 h1:J27LZFQBFoihqXoegpscI10HpjZ7B5WQLLKL2FZXQKw=
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
suah.dev/protect v1.2.0 h1:4G4V43yVYXCjLFzaE9QJR0fLo3rf5vNBS9YxyoI19DU=
suah.dev/protect v1.2.0/go.mod h1:Ocn1yqUskqe/is6N2bxQxtT+fegbvQsOFyHbJAQu9XE=

25
main.go
View File

@ -177,19 +177,32 @@ func makeRSS(q *GHResp) {
log.Fatal(err) log.Fatal(err)
} }
feed.WriteAtom(atomFile) err = feed.WriteAtom(atomFile)
feed.WriteRss(rssFile) if err != nil {
log.Fatal(err)
}
err = feed.WriteRss(rssFile)
if err != nil {
log.Fatal(err)
}
}
func dieOnErr(err error) {
if err != nil {
log.Fatalln(err)
}
} }
func main() { func main() {
flag.StringVar(&search, "search", "OpenBSD", "thing to search GitHub for") flag.StringVar(&search, "search", "OpenBSD", "thing to search GitHub for")
flag.StringVar(&prefix, "prefix", "", "prefix to prepend to file names") flag.StringVar(&prefix, "prefix", "", "prefix to prepend to file names")
flag.Parse() flag.Parse()
protect.Unveil("./", "rwc")
protect.Unveil("/etc/ssl/cert.pem", "r")
protect.Pledge("stdio unveil rpath wpath cpath flock dns inet")
protect.UnveilBlock() dieOnErr(protect.Unveil("./", "rwc"))
dieOnErr(protect.Unveil("/etc/ssl/cert.pem", "r"))
dieOnErr(protect.Pledge("stdio unveil rpath wpath cpath flock dns inet"))
dieOnErr(protect.UnveilBlock())
var q GQLQuery var q GQLQuery
q.Query = fmt.Sprintf(ghQuery, search) q.Query = fmt.Sprintf(ghQuery, search)