The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
46fo

为什么 go 安装包不包含 golang.org/x/net/context 进去?

  •  
  •   46fo · Jan 20, 2017 · 1665 views
    This topic created in 3429 days ago, the information mentioned may be changed or developed.
    添加完 sqlite 后编译提示 cannot find package "golang.org/x/net/context" in any of: ,发现这个谷歌自己的,且好像还有其他的包,好奇问为啥不直接添加进安装包里去???
    4 replies    2017-02-08 10:00:28 +08:00
    wweir
        1
    wweir  
       Jan 20, 2017   ❤️ 1
    那是因为它包含到 "context" 包里了,这个是作为 1.7 的特性被写到 release note 里的。
    改个导入地址吧,不少第三方包没能在这半年半年内跟上 go 的节奏。
    janxin
        2
    janxin  
       Jan 20, 2017 via iPhone   ❤️ 1
    这个功能是 1.7 的新功能,考虑到很多版本并未迁移的用户所以保留了这个路径。如果你使用了 1.8 版本的 go ,可以使用 go fix 自动修复
    Reficul
        3
    Reficul  
       Jan 20, 2017 via Android   ❤️ 1
    想起来因为自动 import 导致两个文件导入了不同的 context 的悲剧事件😂
    JohnSmith
        4
    JohnSmith  
       Feb 8, 2017 via iPhone
    不同 context 其实很多时候使用得当可以兼容,毕竟他们有相同的 interface
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4324 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 10:09 · PVG 18:09 · LAX 03:09 · JFK 06:09
    ♥ Do have faith in what you're doing.