Skip to content

Commit

Permalink
Merge pull request #41 from ernestio/service-id
Browse files Browse the repository at this point in the history
correctly handling new and old service id types
  • Loading branch information
g3kk0 authored Jul 13, 2017
2 parents d8df660 + 9777554 commit 789990c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
8 changes: 0 additions & 8 deletions component.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package main
import (
"encoding/json"
"log"
"strings"

"github.com/nats-io/nats"
"github.com/r3labs/sse"
Expand Down Expand Up @@ -50,12 +49,5 @@ func processComponent(msg *nats.Msg) {
}

func (c *Component) getID() string {
if strings.Contains(c.Service, "-") {
var pieces []string
pieces = strings.Split(c.Service, "-")

return pieces[len(pieces)-1]
}

return c.Service
}
6 changes: 1 addition & 5 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package main
import (
"encoding/json"
"log"
"strings"
"time"

"github.com/nats-io/nats"
Expand Down Expand Up @@ -57,8 +56,5 @@ func processService(msg *nats.Msg) {
}

func (s *Service) getID() string {
var pieces []string
pieces = strings.Split(s.ID, "-")

return pieces[len(pieces)-1]
return s.ID
}

0 comments on commit 789990c

Please sign in to comment.