1
0
mirror of https://github.com/rancher/os.git synced 2025-08-17 14:28:16 +00:00

Upgrade golang compiler to latest; go fmt files.

This commit is contained in:
Lonnie Liu 2021-02-15 14:23:01 -08:00 committed by Olli Janatuinen
parent 6cde287f87
commit af08844a9a
4 changed files with 24 additions and 23 deletions

View File

@ -111,7 +111,7 @@ ENV BUILD_DOCKER_URL=BUILD_DOCKER_URL_${ARCH} \
DISTRIB_ID=${DISTRIB_ID} \
DOWNLOADS=/usr/src/downloads \
GOPATH=/go \
GO_VERSION=1.8.5 \
GO_VERSION=1.15.8 \
GOARCH=$ARCH \
HOSTNAME_DEFAULT=${HOSTNAME_DEFAULT} \
IMAGE_NAME=${IMAGE_NAME} \
@ -142,6 +142,7 @@ ENV BUILD_DOCKER_URL=BUILD_DOCKER_URL_${ARCH} \
PROXMOXVE_SERVICE=${PROXMOXVE_SERVICE} \
SKIP_BUILD=${SKIP_BUILD}
ENV PATH=${GOPATH}/bin:/usr/local/go/bin:$PATH
ENV GO111MODULE=off
RUN mkdir -p ${DOWNLOADS}
@ -156,11 +157,11 @@ RUN echo "... Downloading ${!KERNEL_URL}"; \
RUN curl -pfL ${SELINUX_POLICY_URL} > ${DOWNLOADS}/$(basename ${SELINUX_POLICY_URL})
# Install Go
RUN wget -O - https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz | tar -xzf - -C /usr/local && \
RUN curl -L https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz | tar -xzf - -C /usr/local && \
go get github.com/burmilla/trash
RUN mkdir -p ${GOPATH}/src/golang.org/x && cd ${GOPATH}/src/golang.org/x/ && git clone https://github.com/golang/tools && \
cd tools && git checkout 6adeb8aab2ded9eb693b831d5fd090c10a6ebdfa -b temp && go get golang.org/x/lint/golint
# Install golint
RUN go get golang.org/x/lint/golint
# Install Host Docker
RUN curl -fL ${!BUILD_DOCKER_URL} > /usr/bin/docker && \

View File

@ -70,13 +70,13 @@ func TestFetchMetadata(t *testing.T) {
RootDisk: "/dev/xvda",
NetworkConfig: netconf.NetworkConfig{
Interfaces: map[string]netconf.InterfaceConfig{
/* "eth0": netconf.InterfaceConfig{
Addresses: []string{
"1.2.3.4",
"5.6.7.8",
/* "eth0": netconf.InterfaceConfig{
Addresses: []string{
"1.2.3.4",
"5.6.7.8",
},
},
},
*/},
*/},
},
},
},
@ -100,13 +100,13 @@ func TestFetchMetadata(t *testing.T) {
RootDisk: "/dev/nvme0n1",
NetworkConfig: netconf.NetworkConfig{
Interfaces: map[string]netconf.InterfaceConfig{
/* "eth0": netconf.InterfaceConfig{
Addresses: []string{
"1.2.3.4",
"5.6.7.8",
/* "eth0": netconf.InterfaceConfig{
Addresses: []string{
"1.2.3.4",
"5.6.7.8",
},
},
},
*/},
*/},
},
},
},

View File

@ -20,10 +20,10 @@ import (
func TestFormatConfigs(t *testing.T) {
for in, n := range map[string]int{
"": 0,
"line1\\\nis long": 1,
"#comment": 0,
"#comment\\\ncomment": 0,
"": 0,
"line1\\\nis long": 1,
"#comment": 0,
"#comment\\\ncomment": 0,
" #comment \\\n comment\nline 1\nline 2\\\n is long": 2,
} {
lines := formatConfig(in)

View File

@ -198,11 +198,11 @@ func TestGet(t *testing.T) {
}
tests := map[string]interface{}{
"key": "value",
"key": "value",
"rancher.key2.subkey": "subvalue",
"rancher.key2.subnum": 42,
"rancher.key2.subkey2": "",
"foo": "",
"foo": "",
}
for k, v := range tests {
@ -241,7 +241,7 @@ func TestSet(t *testing.T) {
}
tests := map[string]interface{}{
"key": "value2",
"key": "value2",
"rancher.key2.subkey": "subvalue2",
"rancher.key2.subkey2": "value",
"rancher.key2.subkey3": 43,