Skip to content

Commit

Permalink
feat: fixed go vet issues.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Neudegg <andrew.neudegg@finbourne.com>
  • Loading branch information
AndrewNeudegg committed Dec 26, 2020
1 parent bce6f10 commit b86e933
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/sink/main.go
Expand Up @@ -45,7 +45,7 @@ func main() {
mq := make(chan *sink.SunkMessage)

sinkServer, err := sink.NewHTTPSinkServer(&sink.HttpSinkServerConfiguration{
SinkServerConfiguration: sink.SinkServerConfiguration{
ServerConfiguration: sink.ServerConfiguration{
ToChan: mq,
},
ListenAddr: ":8080",
Expand Down
6 changes: 3 additions & 3 deletions pkg/sink/http.go
Expand Up @@ -13,7 +13,7 @@ import (
)

type HttpSinkServerConfiguration struct {
SinkServerConfiguration
ServerConfiguration
ListenAddr string
}

Expand Down Expand Up @@ -62,7 +62,7 @@ func (s *httpSinkServer) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
return
}

s.config.SinkServerConfiguration.ToChan <- &SunkMessage{
s.config.ServerConfiguration.ToChan <- &SunkMessage{
MessageID: &uniqueID,
Host: &r.Host,
ContentType: &contentType,
Expand All @@ -85,7 +85,7 @@ func (s *httpSinkServer) Stop(ctx context.Context) error {
return s.server.Shutdown(ctx)
}

func NewHTTPSinkServer(c *HttpSinkServerConfiguration) (SinkServer, error) {
func NewHTTPSinkServer(c *HttpSinkServerConfiguration) (Server, error) {
return &httpSinkServer{
config: c,
}, nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/sink/server.go
Expand Up @@ -2,11 +2,11 @@ package sink

import "context"

type SinkServerConfiguration struct {
type ServerConfiguration struct {
ToChan chan *SunkMessage
}

type SinkServer interface {
type Server interface {
Serve(ctx context.Context) error
Stop(ctx context.Context) error
}

0 comments on commit b86e933

Please sign in to comment.