@@ -118,7 +118,7 @@ func profileAdd(ctx *cli.Context) error {
118118 // Create a profile struct from all the global options.
119119 profile , err := profileFromContext (ctx , true , false )
120120 if err != nil {
121- return fmt .Errorf ("could not load global options: %v " , err )
121+ return fmt .Errorf ("could not load global options: %w " , err )
122122 }
123123
124124 // Finally, all that's left is to get the profile name from either
@@ -149,7 +149,7 @@ func profileAdd(ctx *cli.Context) error {
149149 // All done, store the updated profile file.
150150 f .Profiles = append (f .Profiles , profile )
151151 if err = saveProfileFile (defaultProfileFile , f ); err != nil {
152- return fmt .Errorf ("error writing profile file %s: %v " ,
152+ return fmt .Errorf ("error writing profile file %s: %w " ,
153153 defaultProfileFile , err )
154154 }
155155
@@ -180,7 +180,7 @@ func profileRemove(ctx *cli.Context) error {
180180 // Load the default profile file.
181181 f , err := loadProfileFile (defaultProfileFile )
182182 if err != nil {
183- return fmt .Errorf ("could not load profile file: %v " , err )
183+ return fmt .Errorf ("could not load profile file: %w " , err )
184184 }
185185
186186 // Get the profile name from either positional argument or flag.
@@ -255,7 +255,7 @@ func profileSetDefault(ctx *cli.Context) error {
255255 // Load the default profile file.
256256 f , err := loadProfileFile (defaultProfileFile )
257257 if err != nil {
258- return fmt .Errorf ("could not load profile file: %v " , err )
258+ return fmt .Errorf ("could not load profile file: %w " , err )
259259 }
260260
261261 // Get the profile name from either positional argument or flag.
@@ -308,7 +308,7 @@ func profileUnsetDefault(_ *cli.Context) error {
308308 // Load the default profile file.
309309 f , err := loadProfileFile (defaultProfileFile )
310310 if err != nil {
311- return fmt .Errorf ("could not load profile file: %v " , err )
311+ return fmt .Errorf ("could not load profile file: %w " , err )
312312 }
313313
314314 // Save the file with the flag disabled.
@@ -354,7 +354,7 @@ func profileAddMacaroon(ctx *cli.Context) error {
354354 // yet.
355355 f , err := loadProfileFile (defaultProfileFile )
356356 if err != nil {
357- return fmt .Errorf ("could not load profile file: %v " , err )
357+ return fmt .Errorf ("could not load profile file: %w " , err )
358358 }
359359
360360 // Finally, all that's left is to get the profile name from either
@@ -420,25 +420,25 @@ func profileAddMacaroon(ctx *cli.Context) error {
420420 macPath := lncfg .CleanAndExpandPath (ctx .GlobalString ("macaroonpath" ))
421421 macBytes , err := os .ReadFile (macPath )
422422 if err != nil {
423- return fmt .Errorf ("unable to read macaroon path: %v " , err )
423+ return fmt .Errorf ("unable to read macaroon path: %w " , err )
424424 }
425425 mac := & macaroon.Macaroon {}
426426 if err = mac .UnmarshalBinary (macBytes ); err != nil {
427- return fmt .Errorf ("unable to decode macaroon: %v " , err )
427+ return fmt .Errorf ("unable to decode macaroon: %w " , err )
428428 }
429429 macEntry := & macaroonEntry {
430430 Name : macName ,
431431 }
432432 if err = macEntry .storeMacaroon (mac , nil ); err != nil {
433- return fmt .Errorf ("unable to store macaroon: %v " , err )
433+ return fmt .Errorf ("unable to store macaroon: %w " , err )
434434 }
435435
436436 // All done, store the updated profile file.
437437 selectedProfile .Macaroons .Jar = append (
438438 selectedProfile .Macaroons .Jar , macEntry ,
439439 )
440440 if err = saveProfileFile (defaultProfileFile , f ); err != nil {
441- return fmt .Errorf ("error writing profile file %s: %v " ,
441+ return fmt .Errorf ("error writing profile file %s: %w " ,
442442 defaultProfileFile , err )
443443 }
444444
0 commit comments