This is a created article in which the information may have evolved or changed.
Objective
Recently in the survey Google Kubernetes Open source container orchestration platform, just also learning the go language, so want to see Google such a giant is how to go language, this article briefly describes how to download k8s source code, import idea Goland (yes, I'm a Java ~), for such a large project, no IDE seems to be very laborious, of course, except for cattle.
Download source code
It goes without saying that people in the global village should all know
# mkdir -p /opt/kubernetes-src/src/k8s.io# cd /opt/kubernetes-src/src/k8s.io/# git clone https://github.com/kubernetes/kubernetes.git# git checkout release-1.9
Because the project Gopath (Gopath per project private) is configured for/OPT/KUBERNETES-SRC in Goland, the/OPT/KUBERNETES-SRC directory is built under Src/k8s.io, As for why the directory is called K8s.io, the import of this rollover code is clear, if you do not want to import the code after the various can not find the import package (symbol) of the ^_-
Import Goland
Goland before the Intellij + Go plugin, goland out of the download immediately after the experience, it feels good
- Open Goland
- Select New Project
- Point destination folder to/opt/kubernetes-src
- After confirming that the folder is not empty, continue, click OK.
Slowly wait for the IDE to finish indexing the source code
Summarize
This article introduces how to import k8s source code into Goland, prepare for further learning source code.