Skip to content

Commit

Permalink
changing setters to have set in name
Browse files Browse the repository at this point in the history
  • Loading branch information
dan9186 committed May 8, 2016
1 parent 1041cca commit 6cc98d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ext/examples/example2/example2.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Response struct {
}

func main() {
StatusResponse(&Response{Application: "Foo", Version: "1.0.0", BuildTime: "Today"})
SetStatusResponse(&Response{Application: "Foo", Version: "1.0.0", BuildTime: "Today"})
go startServiceLoop()
select {}
}
Expand Down
4 changes: 2 additions & 2 deletions steward.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ func HandleStatus(w http.ResponseWriter, req *http.Request) {
w.Write(payload)
}

func StatusResponse(v interface{}) {
func SetStatusResponse(v interface{}) {
resp = v
}

func StatusEndpoint(e string) {
func SetStatusEndpoint(e string) {
endpoint = e
http.Handle(endpoint, http.HandlerFunc(HandleStatus))
}
2 changes: 1 addition & 1 deletion steward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestStewardEndpoint(t *testing.T) {
})

g.It("should return a custom status response payload", func() {
StatusResponse(&Response{Application: "Foo", Version: "1.0.0", BuildTime: "now"})
SetStatusResponse(&Response{Application: "Foo", Version: "1.0.0", BuildTime: "now"})
req, err := http.NewRequest("GET", server.URL+endpoint, nil)
Expect(err).NotTo(HaveOccurred())

Expand Down

0 comments on commit 6cc98d7

Please sign in to comment.