小编yna*_*ame的帖子

如果 go 包名称不以 github.com 开头,需要注意什么?

我最近开始使用 go 并计划为我的代码使用以下目录结构:(src/mycompany.com/project因此包名称为mycompany.com/project/component),但是在代码审查期间,我的同事(以前使用过 go)指出,将代码放在src/github.com/mycompany/project(所以包名称是github.com/mycompany/project/component)。

我可以理解这对于个人项目来说很方便,但是对于公司项目来说它看起来很奇怪。为什么使用哪个源代码控制网站公司很重要?如果公司稍后决定迁移到 bitbucket,该怎么办 - 所有项目都应该重构为以 开头的包名称吗bitbucket.org

绝对可以不使用github.comkubernetes的包名称以 开头k8s.io/kubernetes,而 go book 的包名称以 开头gopl.io(并且都使用 github)。

问题是:如果包名称不以 开头,有什么注意事项吗github.com?例如,可能dep无法正常工作(go get seems to work fine)或其他什么?

mycompany.com/project另外:在 github 上托管包名称和源代码的正确方法是什么?

naming-conventions go godeps

7
推荐指数
1
解决办法
2441
查看次数

如何配置 bazel 来运行地址/内存清理程序?

我在 bazel 中有一个项目,具有非常简单的 bulid 规则

cc_binary(
  name = "search",
  srcs = [
    "iterator_range.h",
    "main.cpp",
    "parse.cpp",
    "parse.h",
    "search_server.cpp",
    "search_server.h",
    "test_runner.h",
    "profile.h",
  ]
)
Run Code Online (Sandbox Code Playgroud)

我越来越Segmentation fault 11

我尝试使用此配置但出现错误

every rule of type cc_binary implicitly depends upon the target '//tools/lrte:toolchain', but this target coul
d not be found because of: no such package 'tools/lrte': BUILD file not found in any of the following directories
Run Code Online (Sandbox Code Playgroud)

c++ address-sanitizer bazel

6
推荐指数
1
解决办法
6139
查看次数

Chrome扩展程序:正确添加具有非持久性背景页面的上下文菜单条目

我正在开发一个简单的链接共享扩展(插板,可读性,美味等),并且有一个关于如何正确处理上下文菜单项的问题.在我的非持久性背景页面中,我调用chrome.contextMenus.createchrome.contextMenus.onClicked.addListener设置/响应上下文菜单.

上下文菜单条目按预期工作.但是后台页面显示以下错误(在它开始之后和我使用该条目之前):

contextMenus.create: Cannot create item with duplicate id id_share_link at chrome-extension://.../share.js:52:30 lastError:29 set  
Run Code Online (Sandbox Code Playgroud)

这让我意识到,我绝不会删除项目或听众.对javascript和扩展知之甚少,我想知道我是否正确地做了一切.我假设这个顶级代码将在每次调用后台页面时重新执行.因此,对create和addListener进行冗余调用(因此我看到记录的错误).

我显然无法进行清理以响应暂停,因为这些调用需要存在才能唤醒后台脚本.

我应该以不同方式处理事情吗?

html javascript google-chrome delicious-api google-chrome-extension

3
推荐指数
2
解决办法
1455
查看次数