-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base64 decode map added for app secret
- Loading branch information
Showing
3 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package utils | ||
|
||
import ( | ||
"encoding/base64" | ||
) | ||
|
||
func DecodeBase64(base64_encode_data map[string]string) (map[string]string, error) { | ||
var decoded_map map[string]string = make(map[string]string) | ||
|
||
for k, v := range base64_encode_data { | ||
data, err := base64.StdEncoding.DecodeString(v) | ||
if err != nil { | ||
return nil, err | ||
} | ||
decoded_map[k] = string(data) | ||
} | ||
return decoded_map, nil | ||
} |