소스 검색

fix off by one error in GetID

Matthew R Kasun 3 년 전
부모
커밋
fd981f3d3a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      mq/mq.go

+ 1 - 1
mq/mq.go

@@ -175,5 +175,5 @@ func GetID(topic string) (string, error) {
 		return "", errors.New("invalid topic")
 	}
 	//the last part of the topic will be the node.ID
-	return parts[count], nil
+	return parts[count-1], nil
 }