Skip to content

Commit fdb6c62

Browse files
committed
lndclient: Use TrimSuffix instead of ReplaceAll
Use strings.TrimSuffix instead of strings.ReplaceAll in the macaroon recipe code. This is necessary because the WtClient macaroon name contains the word "client" and would be malformed in the old code. New code just removes the last "client".
1 parent b14415f commit fdb6c62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

macaroon_recipes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func MacaroonRecipe(c LightningClient, packages []string) ([]MacaroonPermission,
7777
// From the pointer type we can find out the interface, its name
7878
// and what methods it declares.
7979
ifaceType := reflect.TypeOf(ifacePtr).Elem()
80-
serverName := strings.ReplaceAll(ifaceType.Name(), "Client", "")
80+
serverName := strings.TrimSuffix(ifaceType.Name(), "Client")
8181
for i := range ifaceType.NumMethod() {
8282
// The methods in lndclient might be called slightly
8383
// differently. Rename according to our rename mapping

0 commit comments

Comments
 (0)