Skip to content

Commit

Permalink
fixup: format for uknown SVC
Browse files Browse the repository at this point in the history
  • Loading branch information
matzf committed Jun 27, 2023
1 parent 3797888 commit 4aa29eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/addr/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (h SVC) String() string {
}

// BaseString returns the upper case name of the service. For unrecognized services, it
// returns "SVC(<Hex-Value>)".
// returns "<SVC:Hex-Value>".
func (h SVC) BaseString() string {
switch h.Base() {
case SvcDS:
Expand All @@ -101,6 +101,6 @@ func (h SVC) BaseString() string {
case SvcWildcard:
return "Wildcard"
default:
return fmt.Sprintf("SVC:0x%04x", uint16(h))
return fmt.Sprintf("<SVC:0x%04x>", uint16(h))
}
}
2 changes: 1 addition & 1 deletion pkg/addr/svc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestParseSVC(t *testing.T) {

func TestSVCString(t *testing.T) {
cases := map[addr.SVC]string{
addr.SVC(0xABC): "SVC:0x0abc",
addr.SVC(0xABC): "<SVC:0x0abc>",
addr.SvcCS: "CS",
addr.SvcCS.Multicast(): "CS_M",
addr.SvcDS: "DS",
Expand Down
2 changes: 1 addition & 1 deletion pkg/snet/svcaddr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestSVCAddrString(t *testing.T) {
}{
"nil": {
input: &snet.SVCAddr{},
want: "0-0,SVC:0x0000",
want: "0-0,<SVC:0x0000>",
},
}
for n, tc := range tests {
Expand Down

0 comments on commit 4aa29eb

Please sign in to comment.