mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-29 14:56:25 +02:00
there's no need for Options to be a pointer
This commit is contained in:
parent
c5b279b947
commit
4a5f24e4ec
4 changed files with 49 additions and 49 deletions
8
data.go
8
data.go
|
|
@ -51,7 +51,7 @@ type Options struct {
|
|||
FlipHorizontal bool
|
||||
}
|
||||
|
||||
var emptyOptions = new(Options)
|
||||
var emptyOptions = Options{}
|
||||
|
||||
func (o Options) String() string {
|
||||
buf := new(bytes.Buffer)
|
||||
|
|
@ -71,8 +71,8 @@ func (o Options) String() string {
|
|||
return buf.String()
|
||||
}
|
||||
|
||||
func ParseOptions(str string) *Options {
|
||||
o := new(Options)
|
||||
func ParseOptions(str string) Options {
|
||||
o := Options{}
|
||||
|
||||
parts := strings.Split(str, ",")
|
||||
for _, part := range parts {
|
||||
|
|
@ -125,7 +125,7 @@ func ParseOptions(str string) *Options {
|
|||
|
||||
type Request struct {
|
||||
URL *url.URL // URL of the image to proxy
|
||||
Options *Options // Image transformation to perform
|
||||
Options Options // Image transformation to perform
|
||||
}
|
||||
|
||||
// NewRequest parses an http.Request into an image request.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue