小编Not*_*fer的帖子

推荐用于CI服务器的Go构建系统?

所以我有一个go-gettable依赖项,测试等项目.

我想把它整合到Jenkins中.除了编写makefile之外,是否存在任何人为此用例推荐的自动构建系统?

我需要:

  1. 自动安装go-get deps(当然,它们可以在spec文件中)
  2. 递归构建.
  3. 运行测试.
  4. GOPATH/GOROOT管理(隔离SDK和路径)

我过去曾经使用过godag来做这类工作,但似乎有点没有维护.

编辑:目前我正在使用以下脚本直接输入Jenkins作为构建步骤:

#this gets the dependencies but doesn't install them, avoiding permission problems
go get -d

#build the packages, -x outputs the compiler command line
go build -x

#this was tricky - ./... means "for each sub-package recursively"
go test ./... 
Run Code Online (Sandbox Code Playgroud)

go

4
推荐指数
2
解决办法
6437
查看次数

Go中的多线程.有人可以向我解释这些答案吗?

我在模拟考试中得到了两个问题.我得到了答案,但无法弄清楚背后的理由.

我将首先发布代码,然后发布问题和答案.也许有人会这么好解释我的答案?

package main

import "fmt"

func fact(n int, c chan int, d chan int) {

    k := /* code to compute factorial of n */

    z := <- d

    c <- k + z

    d <- z + 1

}

func main() {

    r := 0

    c := make(chan int)
    d := make(chan int)

    for i = 0 ; i < N ; i++ {
        go fact(i,c,d)
    }

    d <- 0

    for j = 0 ; j < N …
Run Code Online (Sandbox Code Playgroud)

concurrency multithreading go goroutine

3
推荐指数
1
解决办法
127
查看次数

Python如何调用C?

Python如何调用C库?例如,Tensorflow我认为主要是用C语言编写的,但可以从Python中使用.我正在考虑在我自己的(解释的)编程语言中实现类似的东西(用Go编写,但我认为它将是一个类似的过程).

Python程序调用C函数时会发生什么?我在想RPC或DLL,但它们似乎都不太可能.

c python dynamic-linking

2
推荐指数
1
解决办法
2036
查看次数