Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func init() {
}

// SetMode sets gin mode according to input string.
// It panics if the value is not a valid gin mode (debug, release, or test).
func SetMode(value string) {
if value == "" {
if flag.Lookup("test.v") != nil {
Expand Down
1 change: 1 addition & 0 deletions render/redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Redirect struct {
}

// Render (Redirect) redirects the http request to new location and writes redirect response.
// It panics if the status code is not a valid redirect status code (300-308, except 201).
func (r Redirect) Render(w http.ResponseWriter) error {
if (r.Code < http.StatusMultipleChoices || r.Code > http.StatusPermanentRedirect) && r.Code != http.StatusCreated {
panic(fmt.Sprintf("Cannot redirect with status code %d", r.Code))
Expand Down
Loading