drl92080 2013-04-29 21:37
浏览 82
已采纳

管理环境变量

I've previously used Python tools like virtualenv and virtualenvwrapper in Python projects, but now I'm working on a project in Go so I'd like a general tool to switch environment variables when I do something like

workon myproject
....
deactivate myproject

I especially like the workflow of virtualenv-wrapper with pre and post activation scripts in which I can preactivate.sh

export MYVAR=xxx 

and postactivate

unset MYVAR

The tools I've mentioned seem to be centered around Python and pip, but since my project is in Go, I don't know if its kosher for me to use Python tools that happen to provide environment variable management features. Anything more general purpose you would suggest and is not hard to set up?

This question is not necessarily Go lang specific.

  • 写回答

3条回答 默认 最新

  • donglan9651 2013-04-30 02:55
    关注

    Yup, you can use gvm:

    https://github.com/moovweb/gvm

    If you've ever used rvm for ruby, it's similar to that.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用