there's no need for Options to be a pointer

This commit is contained in:
Will Norris 2014-11-19 21:59:52 -08:00
parent c5b279b947
commit 4a5f24e4ec
4 changed files with 49 additions and 49 deletions

View file

@ -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.