atc/topgun: format go files

formatting files that were not adhering to default go formatting rules
w/ simplification from `gofmt`:

	git diff master HEAD --name-only | xargs -I[] gofmt -l -s -w []

Signed-off-by: Ciro S. Costa <cscosta@pivotal.io>
Signed-off-by: Sameer Vohra <vohra.sam@gmail.com>
This commit is contained in:
Ciro S. Costa 2020-01-06 14:29:44 -05:00 committed by Sameer Vohra
parent 312f36405a
commit f1eb0be4e8
14 changed files with 47 additions and 50 deletions

View File

@ -247,12 +247,12 @@ func NewTaskDelegate(build db.Build, planID atc.PlanID, credVarsTracker vars.Cre
type taskDelegate struct {
exec.BuildStepDelegate
config atc.TaskConfig
config atc.TaskConfig
build db.Build
eventOrigin event.Origin
}
func(d *taskDelegate) SetTaskConfig(config atc.TaskConfig){
func (d *taskDelegate) SetTaskConfig(config atc.TaskConfig) {
d.config = config
}

View File

@ -230,10 +230,10 @@ var _ = Describe("DelegateFactory", func() {
BeforeEach(func() {
delegate = builder.NewTaskDelegate(fakeBuild, "some-plan-id", credVarsTracker, fakeClock)
someConfig = atc.TaskConfig{
Platform:"some-platform",
Platform: "some-platform",
Run: atc.TaskRunConfig{
Path:"some-foo-path",
Dir: "some-bar-dir",
Path: "some-foo-path",
Dir: "some-bar-dir",
},
}
delegate.SetTaskConfig(someConfig)

View File

@ -76,4 +76,3 @@ var _ = Describe("ArtifactRepository", func() {
})
})

View File

@ -188,7 +188,7 @@ var _ = Describe("PutStep", func() {
})
It("calls RunPutStep with all inputs", func() {
_, _, _, actualContainerSpec, _, _, _, _, _, _, _ := fakeClient.RunPutStepArgsForCall(0)
_, _, _, actualContainerSpec, _, _, _, _, _, _, _ := fakeClient.RunPutStepArgsForCall(0)
Expect(actualContainerSpec.ArtifactByPath).To(HaveLen(3))
Expect(actualContainerSpec.ArtifactByPath["/tmp/build/put/some-other-source"]).To(Equal(fakeOtherArtifact))
Expect(actualContainerSpec.ArtifactByPath["/tmp/build/put/some-mounted-source"]).To(Equal(fakeMountedArtifact))

View File

@ -2,10 +2,10 @@ package exec
import (
"context"
"errors"
"fmt"
"io"
"io/ioutil"
"errors"
"strings"
"code.cloudfoundry.org/lager"

View File

@ -426,11 +426,11 @@ var _ = Describe("TaskStep", func() {
taskResult := worker.TaskResult{
Status: 0,
VolumeMounts: []worker.VolumeMount{
worker.VolumeMount{
{
Volume: fakeVolume1,
MountPath: "some-artifact-root/some-path-1",
},
worker.VolumeMount{
{
Volume: fakeVolume2,
MountPath: "some-artifact-root/some-path-2",
},
@ -827,15 +827,15 @@ var _ = Describe("TaskStep", func() {
fakeTaskResult := worker.TaskResult{
Status: 0,
VolumeMounts: []worker.VolumeMount{
worker.VolumeMount{
{
Volume: fakeVolume1,
MountPath: fakeMountPath1,
},
worker.VolumeMount{
{
Volume: fakeVolume2,
MountPath: fakeMountPath2,
},
worker.VolumeMount{
{
Volume: fakeVolume3,
MountPath: fakeMountPath3,
},
@ -977,15 +977,15 @@ var _ = Describe("TaskStep", func() {
taskResult := worker.TaskResult{
Status: 0,
VolumeMounts: []worker.VolumeMount{
worker.VolumeMount{
{
Volume: fakeVolume1,
MountPath: fakeMountPath1,
},
worker.VolumeMount{
{
Volume: fakeVolume2,
MountPath: fakeMountPath2,
},
worker.VolumeMount{
{
Volume: fakeVolume3,
MountPath: fakeMountPath3,
},
@ -1033,7 +1033,7 @@ var _ = Describe("TaskStep", func() {
taskResult := worker.TaskResult{
Status: 0,
VolumeMounts: []worker.VolumeMount{
worker.VolumeMount{
{
Volume: fakeVolume,
MountPath: fakeMountPath,
},

View File

@ -337,7 +337,7 @@ var _ = Describe("Plan", func() {
Limit: 1,
FailFast: true,
Steps: []atc.Plan{
atc.Plan{
{
ID: "37",
Task: &atc.TaskPlan{
Name: "name",

View File

@ -12,7 +12,7 @@ import (
//go:generate counterfeiter . ResourceFactory
type ResourceFactory interface {
NewResource (source atc.Source, params atc.Params, version atc.Version) Resource
NewResource(source atc.Source, params atc.Params, version atc.Version) Resource
}
type resourceFactory struct {
@ -30,7 +30,6 @@ func (rf resourceFactory) NewResource(source atc.Source, params atc.Params, vers
}
}
//go:generate counterfeiter . Resource
type Resource interface {

View File

@ -10,7 +10,6 @@ import (
var (
resourceFactory resource.ResourceFactory
)
var _ = BeforeEach(func() {

View File

@ -15,24 +15,23 @@ var _ = Describe("Resource", func() {
})
})
Describe("Signature", func(){
Describe("Signature", func() {
var (
resource Resource
source atc.Source
params atc.Params
version atc.Version
source atc.Source
params atc.Params
version atc.Version
)
)
BeforeEach(func(){
source = atc.Source{ "some-source-key": "some-source-value"}
params = atc.Params{ "some-params-key": "some-params-value"}
version = atc.Version{ "some-version-key": "some-version-value"}
BeforeEach(func() {
source = atc.Source{"some-source-key": "some-source-value"}
params = atc.Params{"some-params-key": "some-params-value"}
version = atc.Version{"some-version-key": "some-version-value"}
resource = NewResourceFactory().NewResource(source, params, version)
})
It("marshals the source, params and version", func(){
It("marshals the source, params and version", func() {
actualSignature, err := resource.Signature()
Expect(err).ToNot(HaveOccurred())
Expect(actualSignature).To(MatchJSON(`{

View File

@ -13,8 +13,8 @@ import (
"github.com/concourse/concourse/atc/db/lock/lockfakes"
"github.com/concourse/concourse/atc/exec/execfakes"
"github.com/concourse/concourse/atc/resource/resourcefakes"
"github.com/concourse/concourse/atc/runtime/runtimefakes"
"github.com/concourse/concourse/atc/runtime"
"github.com/concourse/concourse/atc/runtime/runtimefakes"
"github.com/onsi/gomega/gbytes"
"code.cloudfoundry.org/lager/lagertest"
@ -639,15 +639,15 @@ var _ = Describe("Client", func() {
fakeVolume3.HandleReturns("some-handle-3")
fakeContainer.VolumeMountsReturns([]worker.VolumeMount{
worker.VolumeMount{
{
Volume: fakeVolume1,
MountPath: fakeMountPath1,
},
worker.VolumeMount{
{
Volume: fakeVolume2,
MountPath: fakeMountPath2,
},
worker.VolumeMount{
{
Volume: fakeVolume3,
MountPath: fakeMountPath3,
},
@ -1001,15 +1001,15 @@ var _ = Describe("Client", func() {
fakeVolume3.HandleReturns("some-handle-3")
fakeContainer.VolumeMountsReturns([]worker.VolumeMount{
worker.VolumeMount{
{
Volume: fakeVolume1,
MountPath: fakeMountPath1,
},
worker.VolumeMount{
{
Volume: fakeVolume2,
MountPath: fakeMountPath2,
},
worker.VolumeMount{
{
Volume: fakeVolume3,
MountPath: fakeMountPath3,
},

View File

@ -8,9 +8,9 @@ import (
"fmt"
"io"
"github.com/hashicorp/go-multierror"
"code.cloudfoundry.org/lager"
"github.com/DataDog/zstd"
"github.com/hashicorp/go-multierror"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/db"

View File

@ -1355,11 +1355,11 @@ var _ = Describe("Worker", func() {
It("creates each volume unprivileged", func() {
Expect(volumeSpecs).To(Equal(map[string]VolumeSpec{
"/scratch": VolumeSpec{Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir": VolumeSpec{Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir/output": VolumeSpec{Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir/local-input": VolumeSpec{Strategy: fakeLocalVolume.COWStrategy()},
"/some/work-dir/remote-input": VolumeSpec{Strategy: baggageclaim.EmptyStrategy{}},
"/scratch": {Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir": {Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir/output": {Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir/local-input": {Strategy: fakeLocalVolume.COWStrategy()},
"/some/work-dir/remote-input": {Strategy: baggageclaim.EmptyStrategy{}},
}))
})
@ -1401,11 +1401,11 @@ var _ = Describe("Worker", func() {
It("creates each volume privileged", func() {
Expect(volumeSpecs).To(Equal(map[string]VolumeSpec{
"/scratch": VolumeSpec{Privileged: true, Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir": VolumeSpec{Privileged: true, Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir/output": VolumeSpec{Privileged: true, Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir/local-input": VolumeSpec{Privileged: true, Strategy: fakeLocalVolume.COWStrategy()},
"/some/work-dir/remote-input": VolumeSpec{Privileged: true, Strategy: baggageclaim.EmptyStrategy{}},
"/scratch": {Privileged: true, Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir": {Privileged: true, Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir/output": {Privileged: true, Strategy: baggageclaim.EmptyStrategy{}},
"/some/work-dir/local-input": {Privileged: true, Strategy: fakeLocalVolume.COWStrategy()},
"/some/work-dir/remote-input": {Privileged: true, Strategy: baggageclaim.EmptyStrategy{}},
}))
})

View File

@ -9,6 +9,7 @@ import (
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
)
// TODO-Later Move this to a testflight test as there is no relevant IaaS state
var _ = Describe("Container scope", func() {
Context("when the container is scoped to a team", func() {