Golang的学习心得1

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

  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二进制分析

[美]瑞安 奥尼尔 / 棣琦 / 人民邮电出版社 / 2017-12-1 / CNY 59.00

二进制分析属于信息安全业界逆向工程中的一种技术,通过利用可执行的机器代码(二进制)来分析应用程序的控制结构和运行方式,有助于信息安全从业人员更好地分析各种漏洞、病毒以及恶意软件,从而找到相应的解决方案。 本书是一本剖析Linux ELF工作机制的图书,共分为9章,其内容涵盖了Linux环境和相关工具、ELF二进制格式、Linux进程追踪、ELF病毒技术、Linux二进制保护、Linux中的E......一起来看看 《Linux二进制分析》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具