mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
use errors.New when not formatting
This commit is contained in:
@@ -3,7 +3,7 @@ package processor
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"errors"
|
||||
"net/http"
|
||||
"text/template"
|
||||
|
||||
@@ -50,25 +50,25 @@ func init() {
|
||||
method, ok := params["method"]
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("http.request.create requires a method parameter")
|
||||
return nil, errors.New("http.request.create requires a method parameter")
|
||||
}
|
||||
|
||||
methodString, ok := method.(string)
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("http.request.create url must be a string")
|
||||
return nil, errors.New("http.request.create url must be a string")
|
||||
}
|
||||
|
||||
url, ok := params["url"]
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("http.request.create requires a url parameter")
|
||||
return nil, errors.New("http.request.create requires a url parameter")
|
||||
}
|
||||
|
||||
urlString, ok := url.(string)
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("http.request.create url must be a string")
|
||||
return nil, errors.New("http.request.create url must be a string")
|
||||
}
|
||||
|
||||
urlTemplate, err := template.New("url").Parse(urlString)
|
||||
|
||||
Reference in New Issue
Block a user