Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Jul 7, 2020
1 parent 5a30662 commit c9cd38f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 43 deletions.
3 changes: 0 additions & 3 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/sgtm/http_pages.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (svc *Service) profilePage(box *packr.Box) func(w http.ResponseWriter, r *h
}
}

func (svc *Service) newTemplateData(r *http.Request) (templateData, error) {
func (svc *Service) newTemplateData(r *http.Request) (*templateData, error) {
data := templateData{
Title: "SGTM",
Date: time.Now(),
Expand All @@ -93,14 +93,14 @@ func (svc *Service) newTemplateData(r *http.Request) (templateData, error) {
var err error
data.Claims, err = svc.parseJWTToken(data.JWTToken)
if err != nil {
return data, fmt.Errorf("parse jwt token: %w", err)
return nil, fmt.Errorf("parse jwt token: %w", err)
}
if err := svc.db.First(&data.User, data.Claims.Session.UserID).Error; err != nil {
svc.logger.Warn("load user from DB", zap.Error(err))
}
}

return data, nil
return &data, nil
}

func loadTemplate(box *packr.Box, filepath string) *template.Template {
Expand Down
1 change: 1 addition & 0 deletions static/base.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ <h4 class="text-white">@{{.User.Slug}}</h4>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/turbolinks/5.2.0/turbolinks.js" integrity="sha512-G3jAqT2eM4MMkLMyQR5YBhvN5/Da3IG6kqgYqU9zlIH4+2a+GuMdLb5Kpxy6ItMdCfgaKlo2XFhI0dHtMJjoRw==" crossorigin="anonymous"></script>
</body>
</html>
{{end}}

0 comments on commit c9cd38f

Please sign in to comment.