我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何从golang可执行文件中获取当前的gcloud用户名?

I am trying to implement the below gcloud command in Go Lang.

>gcloud config get-value account
abc@def.com

I have looked in "https://godoc.org/cloud.google.com/go", but I am unable to find how I could implement this.

Any suggestions for libraries\code that I could look at?

After significant time investment into researching this, there are no options as of Jan 2019. Best course of action is

gcloud config config-helper --format json

近期文章

  • 在Go中使用Boost进程间机制(托管共享内存,条件变量…)
  • 从Consul获得的具有持久连接的gRPC服务的客户端注册表
  • Goroutines一会儿不回复
  • 为什么goroutine暂停了几分钟
  • 在Firestore中更新值时没有字段错误
  • sqlx将postgres数组扫描到结构中
  • 关系不存在(golang / mac OS)
  • 使用libc而不是glibc的Golang c-archive
  • 带有串行通信的io.Reader中缺少字节
  • 如何将mongodb会话放入creachadair / jrpc2处理程序中
  • 在html模板中找不到自定义模板功能[重复]
  • 阅读缓存DIY图书时出现Go映射线程安全问题
  • 在Firestore中忽略Nil值的最佳做法
  • 无法使用go_client放置GridDB容器
  • 响应后如何关闭连接(使用UNIX套接字)
  • 将stdin复制到缓冲区
  • 通过Golang记录器写日志
  • Golang图像IPTC元数据
  • ZMQ无法接收来自多个发布者的消息
  • Golang https设置麻烦

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华