22 lines
422 B
Go
22 lines
422 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"os"
|
|
osx "github.com/docker/docker-credential-helpers/client"
|
|
)
|
|
|
|
func main() {
|
|
|
|
p := osx.NewShellProgramFunc("docker-credential-desktop")
|
|
|
|
creds, err := osx.Get(p, os.Args[1])
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
fmt.Printf("Got credentials for user `%s` in `%s` with secret `%s` \n", creds.Username, creds.ServerURL, creds.Secret)
|
|
}
|