This file contains hidden or 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
package main | |
import ( | |
"context" | |
"encoding/base64" | |
"fmt" | |
"log" | |
kms "cloud.google.com/go/kms/apiv1" | |
kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1" |
This file contains hidden or 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
package publisher | |
type Store interface { | |
Publish(item map[string]interface{}) (string,error) | |
} | |
type StoreBuilder struct { | |
// Registry holds a map of string (Cloud provider) and Store | |
registry map[string]Store | |
} |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
// len(a)=0, cap(a)=3 | |
a := make([]int, 3, 3) | |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
func sortItems(items []int) []int { | |
sortFunc := func(i int, j int) bool { |