Skip to content

Commit

Permalink
Merge pull request #105 from tsawler/development
Browse files Browse the repository at this point in the history
Improve comments.
  • Loading branch information
tsawler committed May 18, 2023
2 parents fb98062 + f256d60 commit e2c18f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (t *Tools) ErrorJSON(w http.ResponseWriter, err error, status ...int) error
return t.WriteJSON(w, statusCode, payload)
}

// RandomString returns a random string of letters of length n.
// RandomString returns a random string of letters of length n, using characters specified in randomStringSource.
func (t *Tools) RandomString(n int) string {
s, r := make([]rune, n), []rune(randomStringSource)
for i := range s {
Expand Down Expand Up @@ -200,7 +200,7 @@ func (t *Tools) PushJSONToRemote(uri string, data interface{}, client ...*http.C
return response, response.StatusCode, nil
}

// DownloadStaticFile downloads a file, and tries to force the browser to avoid displaying it in
// DownloadStaticFile downloads a file to the remote user, and tries to force the browser to avoid displaying it in
// the browser window by setting content-disposition. It also allows specification of the display name.
func (t *Tools) DownloadStaticFile(w http.ResponseWriter, r *http.Request, p, file, displayName string) {
fp := path.Join(p, file)
Expand Down

0 comments on commit e2c18f4

Please sign in to comment.