
# x go run --pkg github.com/<user>/<repo> [args...]
# x go snap <cmd> [args...]

# x go run github.com/ProtonMail/gosop@main

___x_cmd_go_snap(){
    [ $# -gt 0 ]    || set -- --help
    case "$1" in
        -h|--help)      ___x_cmd help -m go snap "$@"; return 0 ;;
    esac

    local x_="$1";  shift

    case "$x_" in
        *:*)
                # set -- "${x_##*:}" "$@"
                x_="${x_%:*}"
                ;;
        *)
                ___x_cmd install snaplookup_ "$x_" go || N=go M="Cannot locate package according to cmd -> $x_" log:ret:1
                x_="${x_#go/}"
    esac

    # ___x_cmd go run "$x_" "$@"

    ___x_cmd_go_proxy_autocmd run "$x_" "$@"

    # if ___x_cmd websrc is cn; then
    #     # echo GOPROXY="https://goproxy.cn,direct" ___x_cmd go run "$x_" "$@"
    #     GOPROXY="https://goproxy.cn,direct" ___x_cmd go run "$x_" "$@"
    # else
    #     ___x_cmd go run "$x_" "$@"
    # fi

}
