Golang的学习心得1

栏目: Go · 发布时间: 6年前

  1. 对于一个的使用多个 php 传统MVC框架的人来说 Beego 使用起来很简单。
  2. golang 的多赋值特性,有需要注意的地方:
    package   main
    import "fmt"
    func  main(){
       x := []int{1,2,3}
       i := 0
       i,x[i] =2,i
       fmt.Println(i,x)//输出的是 2 【0 2 3】
    }
  3.   go 有项目的管理工具,类似于PHP的Composer。go 原始的import 包会去 %GOPATH% 写的src 找,就很容易的把工程的代码包混淆,不容易管理,同时如果要上传整个项目的代码,还要额外去上传src下被引用的包,这就很麻烦了。当然,dep解决的不止这个问题,Golang 也不止dep这个第三方项目管理工具,但是dep听说比较官方。
  4. <strong>Dep is a tool for managing dependencies for Go projects</strong>
    Usage: "dep [command]"
    Commands:
    init     Set up a new Go project, or migrate an existing one
    status   Report the status of the project's dependencies
    ensure   Ensure a dependency is safely vendored in the project
    version  Show the dep version information
    check    Check if imports, Gopkg.toml, and Gopkg.lock are in sync
    
    Examples:
    dep init                               set up a new project
    dep ensure                             install the project's dependencies
    dep ensure -update                     update the locked versions of all dependencies
    dep ensure -add github.com/pkg/errors  add a dependency to the project
    
    Use "dep help [command]" for more information about a command.
  5. 调试 go 语言出现:exec: "gcc": executable file not found in %PATH%。  意思就是的说系统的PATH 中没有的gcc 的执行命令,我用的是windows,所以的装个系统gcc编译的工具,再将其配置到系统的环境的PATH 中去,安装的链接地址: https://blog.csdn.net/kingmax54212008/article/details/77188836

以上所述就是小编给大家介绍的《Golang的学习心得1》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

现代密码学理论与实践

现代密码学理论与实践

毛文波 / 电子工业出版社 / 2004-1 / 49.00元

现代密码学理论与实践,ISBN:9787505399259,作者:(英)Wenbo Mao著;王继林,伍前红等译;王继林译一起来看看 《现代密码学理论与实践》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具