排行榜

  • 用户榜
  • 标签榜
  • 冲榜分奖金

频道

最新最热悬赏待采纳 筛选
  • 0

    回答

  • 26

    浏览

答完这套题你就知道了。。。。 http://www.gtalent.cn/exam/interview?token=3448af9f01a7b622851f91d0328f3a9e 如果进去手都下不了,说明你还在山底下。。。

  • 3

    回答

  • 21

    浏览

运行 micro new --type "srv"  xm/service/getCaptcha 后出现以下错误 Incorrect Usage: flag provided but not defined: -type NAME:    micro new - Create a service template USAGE:    micro new [command options] [arguments...] DESCRIPTION:    'micro new' scaffolds a new service skeleton. Example: 'micro new helloworld && cd helloworld' OPTIONS:    --help, -h  show help (default: false)     Flag provided but not defined: -type  

  • 3

    回答

  • 9

    浏览

/opt/kubernetes/bin/kubelet --address=10.0.20.183 --hostname-override=10.0.20.183 --pod-infra-container-image=mirrorgooglecontainers/pause-amd64:3.0 --experimental-bootstrap-kubeconfig=/opt/kubernetes/cfg/boots trap.kubeconfig --kubeconfig=/opt/kubernetes/cfg/kubelet.kubeconfig --cert-dir=/opt/kubernetes/ssl --network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/kubernetes/bin/cni --cluster-dns=10.5.0.2 --cluster- domain=cluster.local. --hairpin-mode hairpin-veth --allow-privileged=true --fail-swap-on=false --logtostderr=true --v=2 --logtostderr=false --log-dir=/opt/kubernetes/log/ Flag --address has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information. Flag --experimental-bootstrap-kubeconfig has been deprecated, Use --bootstrap-kubeconfig Flag --cluster-dns has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information. Flag --cluster-domain has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information. Flag --hairpin-mode has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information. Flag --allow-privileged has been deprecated, will be removed in a future version Flag --fail-swap-on has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information. F0428 01:08:22.673946 20797 server.go:262] failed to run Kubelet: unable to load bootstrap kubeconfig: invalid configuration: no configuration has been provided goroutine 1 [running]: k8s.io/kubernetes/vendor/github.com/golang/glog.stacks(0xc420a0fe00, 0xc420b94000, 0xa3, 0x1af) /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:766 +0xcf k8s.io/kubernetes/vendor/github.com/golang/glog.(*loggingT).output(0x65c3520, 0xc400000003, 0xc420a142c0, 0x614c6f0, 0x9, 0x106, 0x0) /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:717 +0x30f k8s.io/kubernetes/vendor/github.com/golang/glog.(*loggingT).printDepth(0x65c3520, 0x3, 0x1, 0xc4206a7b70, 0x1, 0x1) /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:646 +0x129 k8s.io/kubernetes/vendor/github.com/golang/glog.(*loggingT).print(0x65c3520, 0x3, 0xc4206a7b70, 0x1, 0x1) /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:637 +0x5a k8s.io/kubernetes/vendor/github.com/golang/glog.Fatal(0xc4206a7b70, 0x1, 0x1) /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:1125 +0x53 k8s.io/kubernetes/cmd/kubelet/app.NewKubeletCommand.func1(0xc420a20c80, 0xc42004c150, 0x13, 0x13) /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubelet/app/server.go:262 +0x574 k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute(0xc420a20c80, 0xc42004c150, 0x13, 0x13, 0xc420a20c80, 0xc42004c150) /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:760 +0x2c1 k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc420a20c80, 0xc420a0fd10, 0x41b23b0, 0xc4206a7ee8) /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:846 +0x30a k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute(0xc420a20c80, 0x41c24e0, 0x65c3120) /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:794 +0x2b main.main() /workspace/anago-v1.12.10-beta.0.9+e3c134023df5de/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubelet/kubelet.go:43 +0x164  

  • 0

    回答

  • 11

    浏览

type Student struct { Id string `json:"id"` Name string `json:"name"` } studentList := make([]Student,len(stu)) for i, st := range stu { go func(st string){ studentList[i], err = getList(st) if err != nil { return ... //just example } }{st} } //and a function like this func getList(stu string)(res Student, error){ var student Student err := json.Unmarshal(([]byte)(stu), &student) if err != nil { return } return &student,nil } 假设我有stu = [{"id":"001","name":"A"} {"id":"002", "name":"B"}] ,可能更多/ 我想用json.unmarshal解析,但是for循环去调用效率太低,又不想用第三方包。所以想试试并发,GO小白,写的这个返回为空,大佬们帮忙看看

  • 1

    回答

  • 6

    浏览

apiVersion: opswagon.xbc.io/v1 kind: JenkinsPlugin metadata: name: docker-build-production spec: name: docker-build-production title: docker镜像构建上传 sub_title: docker镜像构建上传 icon: icon-jingxiang1 params: - name: username place_holder: $dbp-username$ - name: password place_holder: $dbp-password$ - name: isOnline place_holder: $dbp-isOnline$ - name: docker_repository place_holder: $dbp-docker_repository$ - name: docker_tag place_holder: $dbp-docker_tag$ - name: docker_file_path place_holder: $dbp-docker_file_path$ - name: context_path place_holder: $dbp-context_path$ - name: source place_holder: $$source[.(\w)+]$$ - name: branch place_holder: $dbp-branch$ output: - name: displayName place_holder: $db-out-displayName$ - name: type place_holder: $db-out-type$ - name: identifier place_holder: $db-out-identifier$ - name: description place_holder: $db-out-description$ - name: jobIdentifier place_holder: $db-out-jobIdentifier$ - name: name place_holder: $db-out-name$ code: | stage('$plugin-name$') { steps { container('docker') { script { def context_path = '$dbp-context_path$' if (context_path == '') { context_path = '.' } def file_path = '$dbp-docker_file_path$' if ($dbp-isOnline$) { def now = new Date() file_path = './Dockerfile-'+now.time def the_cmd = "echo '$dbp-docker_file_path$' > #file_path#" the_cmd = the_cmd.replaceAll('file_path', file_path) sh the_cmd } def base_cmd = ''' docker build -t $dbp-docker_repository$:$dbp-docker_tag$ #file_path# #context_path# && \ docker push $dbp-docker_repository$:$dbp-docker_tag$ && \ docker rmi $dbp-docker_repository$:$dbp-docker_tag$ ''' if ('$dbp-username$' != '') { def addr = '$dbp-docker_repository$'.split('/')[0] def login_cmd = 'docker login #addr# -u $dbp-username$ -p $dbp-password$ && \' login_cmd = login_cmd.replaceAll('#addr#', addr) base_cmd = base_cmd + login_cmd } base_cmd = base_cmd.replaceAll('#file_path#', file_path) base_cmd = base_cmd.replaceAll('#context_path#', context_path) sh base_cmd } } } } container: docker 这个会报error converting YAML to JSON: yaml: line 28: mapping values are not allowed in this context,但是K8s是能够解析这个yaml文件的,但是golang读的时候读不出来……

  • 4

    回答

  • 24

    浏览

一直没找到好的解决办法,请大佬们指点一下;

  • 3

    回答

  • 15

    浏览

 <li class="list-group-item"> <a target="rightMain" href="/{{config "String" "adminPath" ""}}/manager">  </a></li>   额  有大佬知道怎么搞么  

  • 0

    回答

  • 5

    浏览

我用go编译了个dll: exp.dll  exp.h C语言里: #include "exp.h" //....(直接调用dll的函数, 因为exp.h里有声明) 编译的时候 gcc test1.c exp.dll -o test1 正常,运行也正常,但是我怀疑他静态链接的时候,我把dll删了,就不能运行,又加回来,能了,说明程序是依赖这个dll的. 但是正常情况下,隐式调用都需要一个静态的导入库,一个头,一个dll吗,我这里直接把dll放进编译参数请问是什么含义?

回答 DogMonkeys
采纳率60%
24天前
  • 2

    回答

  • 31

    浏览

package main import ( "fmt" ) func main(){ //某人有100,000元,每经过一次路口,需要交费,规则如下: //当现金>50000时,每次交5% //当现金<=50000时,每次交1000 //编程计算该人可以经过多少次路口,使用forbreak方式完成 var money float64 = 100000.00 var i int = 0 for { if money > 50000.00 { money = money - money * 5.0% } else if money <=50000.00 && money > 0 { money = money - 1000.00 } else if money == 0 { break } i++ } fmt.Printf("该人可以经过 %v 次路口。", i) }  

回答 程小毅
采纳率0%
25天前
  • 3

    回答

  • 29

    浏览

    初学Golang,遇到一个关于调用自己编写的包里的函数的问题,请各位哥哥姐姐们帮我解答一下: P1-3是我的环境变量的配置(GOPATH,GOROOT,Path) P4是我平时听课练习写代码的文件夹(也是GOPATH的环境配置文件)P5是sdk所在的目录(GOROOT的环境配置文件)P6是自己编写的包及函数P7是引用失败的代码(utils包放在GOPATH的环境中时)P8是go run 之后的报错提示P9是引用成功的代码(utils包放在GOROOT的环境中的src中时)P10是go run 之后的运行结果。        我按照老师讲的(P6,P7的写法)但是运行失败,老师说会在GOPATH环境下的src中去找对应的包,但是它提示该目录不在GOROOT中,这是为什么,以后写程序只能吧想要引用的目录放在GOROOT环境中的src中吗?求讲讲其中的原理,有没有环境配置错的地方?求解答。  

  • 0

    回答

  • 16

    浏览

package main import( "sync" ) func ff(str string) int { var result string result = str+" " lenn:=len(result) return lenn } func ff2(str string) int { var result string result = str lenn:=len(result) return lenn } func main(){ s := "asdbvbhfbdjaasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklasdbvbhfbdjaibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklibfdjiagjnagjnagjandgjangkjxnzjlbgjbgjfdjkgbjkalbgjkldbajgklbag" n:=1000 var wg sync.WaitGroup wg.Add(n) for i:=1;i<=n;i++{ go func() int{ num:=0 for{ //num+=ff(s) num=ff2(s) } wg.Done() return num }() } wg.Wait() }   写了简单的并发例子,调用ff时,cpu的使用情况如下,并没有使用满: 但是调用ff2时,cpu的使用情况如下,使用满了: 想知道为什么go在调用ff时没有办法将cpu使用满 另外加减并发数并不会对cpu使用率有什么影响 当前总内存剩余非常充足 尝试使用sync.Pool进行分配也是这个结果 go版本为1.13,机器内核数为16 希望大佬能帮我解释一下,,是go分配内存太慢了还是怎么回事    

回答 Aiky哇
采纳率0%
27天前
  • 2

    回答

  • 41

    浏览

网上能查到的方式都试了个遍,没用   Python文件路径: golang导入代码: 运行结果: