Sebastian P Sobolewski 3df3079594 Update 'README.md' | 1 year ago | |
---|---|---|
README.md | 1 year ago |
https://encore.dev/guide/go.mod
.meta = map[string]string{ "sidebar": "glance" }
// compare a value at key
{{ if eq (index .Meta "sidebar") "glance" }}
// enumerate map
{{ range .Meta }}
// value assignment
{{ $selected := index .Meta "sidebar" }}
// setting option values
{{ $selected := index .Meta "sidebar" }}
<select value="{{ $selected }}">
{{ range .Options }}
{{ if eq . $selected }}
<option selected>{{ . }}</option>
{{ else }}
<option>{{ . }}</option>
{{ end }}
{{ end }}
</select>
ssh-keygen -t ecdsa -f ecdsa -b 256 -m pem
func LoadKey(path string) error {
raw, err := os.ReadFile(path)
if err != nil {
return err
}
for {
block, rest := pem.Decode(raw)
if block == nil {
break
}
if block.Type == "CERTIFICATE" {
dst := make([]byte, base64.StdEncoding.EncodedLen(len(block.Bytes)))
base64.StdEncoding.Encode(dst, block.Bytes)
fmt.Printf("C: %s\n", string(dst))
} else {
dst := make([]byte, base64.StdEncoding.EncodedLen(len(block.Bytes)))
base64.StdEncoding.Encode(dst, block.Bytes)
fmt.Printf("K: %s\n", string(dst))
fmt.Printf("K: %s\n", string(dst))
}
raw = rest
}
return nil
}