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》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

Linux集群体系结构

Linux集群体系结构

Alex Vrenios / 马朝晖 / 机械工业出版社 / 2003-1 / 38.00元

本书对Linux集群体系结构的硬件环境组建与其软件开发作了深入细致的介绍。通过阅读本书,可以对Linux集群体系结构有深入的认识,掌握并了解如何设计和构造集群计算机。本书使你了解到开发项目可能遇到的问题,并掌握测试和调整分布式算法。 本书适合计算机系统集成技术人员、管理人员和计算机科研人员作为参考。一起来看看 《Linux集群体系结构》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具