diff --git a/.gitignore b/.gitignore index 0893c76..94c729b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ subs/ resp/ bytegolf.exe qs/ -localfiles/ \ No newline at end of file +localfiles/ +vendor \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..436d022 --- /dev/null +++ b/go.mod @@ -0,0 +1,11 @@ +module github.com/Squwid/bytegolf + +require ( + github.com/aws/aws-sdk-go v1.19.15 + github.com/kr/pretty v0.1.0 // indirect + github.com/satori/go.uuid v1.2.0 + github.com/stretchr/testify v1.3.0 // indirect + golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480 + golang.org/x/net v0.0.0-20190419010253-1f3472d942ba // indirect + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..64472b6 --- /dev/null +++ b/go.sum @@ -0,0 +1,29 @@ +github.com/aws/aws-sdk-go v1.19.15 h1:Ov8zxPunHxZFxrXBarqzkZBSZugJRzPgb4mfq/SyVgA= +github.com/aws/aws-sdk-go v1.19.15/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480 h1:O5YqonU5IWby+w98jVUG9h7zlCWCcH4RHyPVReBmhzk= +golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/net v0.0.0-20190419010253-1f3472d942ba h1:h0zCzEL5UW1mERvwTN6AXcc75PpLkY6OcReia6Dq1BM= +golang.org/x/net v0.0.0-20190419010253-1f3472d942ba/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/questions/questions.go b/questions/questions.go index 236b417..9f53310 100644 --- a/questions/questions.go +++ b/questions/questions.go @@ -34,7 +34,7 @@ type Question struct { // NewQuestion creates a new question with a UUID func NewQuestion(name, question, input, answer, difficulty, source string, live bool) *Question { - uuid, _ := uuid.NewV4() + uuid := uuid.NewV4() return &Question{ ID: uuid.String(), Name: name, diff --git a/runner/models.go b/runner/models.go index 77e3b8b..a06ff85 100644 --- a/runner/models.go +++ b/runner/models.go @@ -116,7 +116,7 @@ func NewClientWithCreds(id, secret string) *Client { // NewCodeSubmission todo: func NewCodeSubmission(email, username, questionID, input, filename, language, code string, client *Client, sess *session.Session) *CodeSubmission { - id, _ := uuid.NewV4() + id := uuid.NewV4() vi := "0" if language == LangBash { vi = "2" diff --git a/sessions.go b/sessions.go index d73253b..0f36f5a 100644 --- a/sessions.go +++ b/sessions.go @@ -16,10 +16,7 @@ func logOn(w http.ResponseWriter, email string) (aws.User, error) { if err != nil { return user, err } - id, err := uuid.NewV4() - if err != nil { - return user, err // this code is probably not accessable but just in case of bs - } + id := uuid.NewV4() idString := id.String() cookie := &http.Cookie{