@@ -296,23 +296,25 @@ func GetAction(c *cli.Context) {
296
296
log .Fatal (err )
297
297
}
298
298
299
- fmt .Printf ("%s\n " , value )
299
+ fmt .Printf ("%s" , value )
300
300
}
301
301
302
302
func SetAction (c * cli.Context ) {
303
303
var key string
304
- var value interface {}
304
+ var value string
305
305
var err error
306
306
307
307
// If the --file flag is provided
308
308
if c .String ("file" ) != "" && hasExpectedArgs (c .Args (), 1 ) {
309
309
// And the file actually exists on file system
310
310
if pathExists (c .String ("file" )) {
311
311
// Then load it's content
312
- value , err = ioutil .ReadFile (c .String ("file" ))
312
+ fileContent , err : = ioutil .ReadFile (c .String ("file" ))
313
313
if err != nil {
314
314
log .Fatal (err )
315
315
}
316
+
317
+ value = string (fileContent )
316
318
} else {
317
319
log .Fatalf ("Cannot open %s because it doesn't exist" , c .String ("file" ))
318
320
}
@@ -344,7 +346,7 @@ func SetAction(c *cli.Context) {
344
346
log .Fatal (err )
345
347
}
346
348
347
- fmt .Printf ("%s:%s\n " , key , value )
349
+ fmt .Printf ("%s:%s" , key , value )
348
350
}
349
351
350
352
func DelAction (c * cli.Context ) {
@@ -372,7 +374,7 @@ func DelAction(c *cli.Context) {
372
374
log .Fatal (err )
373
375
}
374
376
375
- fmt .Printf ("deleted: %s\n " , c .Args ()[0 ])
377
+ fmt .Printf ("deleted: %s" , c .Args ()[0 ])
376
378
}
377
379
378
380
func KeysAction (c * cli.Context ) {
0 commit comments