fix(omaha): use struct initialization
save some lines of code and use struct initialization
This commit is contained in:
parent
8a80b4e359
commit
8536d53703
1 changed files with 2 additions and 9 deletions
|
@ -30,10 +30,7 @@ type Request struct {
|
||||||
func NewRequest(version string, platform string, sp string, arch string) *Request {
|
func NewRequest(version string, platform string, sp string, arch string) *Request {
|
||||||
r := new(Request)
|
r := new(Request)
|
||||||
r.Protocol = "3.0"
|
r.Protocol = "3.0"
|
||||||
r.Os.Version = version
|
r.Os = Os{Version: version, Platform: platform, Sp: sp, Arch: arch}
|
||||||
r.Os.Platform = platform
|
|
||||||
r.Os.Sp = sp
|
|
||||||
r.Os.Arch = arch
|
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,11 +135,7 @@ type Os struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewOs(platform string, version string, sp string, arch string) *Os {
|
func NewOs(platform string, version string, sp string, arch string) *Os {
|
||||||
o := new(Os)
|
o := &Os{Version: version, Platform: platform, Sp: sp, Arch: arch}
|
||||||
o.Version = version
|
|
||||||
o.Platform = platform
|
|
||||||
o.Sp = sp
|
|
||||||
o.Arch = arch
|
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue