From 1ba5996cc2e4fcfa2e92db57f17e350c3c33e7a2 Mon Sep 17 00:00:00 2001 From: Sam Pointer Date: Sat, 4 Apr 2020 19:12:49 +0100 Subject: [PATCH] correct lint --- divvyyaml/divvyyaml.go | 2 +- divvyyaml/divvyyaml_test.go | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/divvyyaml/divvyyaml.go b/divvyyaml/divvyyaml.go index 3dbc2bd..5700ef3 100644 --- a/divvyyaml/divvyyaml.go +++ b/divvyyaml/divvyyaml.go @@ -7,7 +7,7 @@ import ( "strings" ) -// Represents a DivvyYaml document and its methods +// DivvyYaml represents a document and its methods type DivvyYaml struct { Doc string // The constructed YAML document } diff --git a/divvyyaml/divvyyaml_test.go b/divvyyaml/divvyyaml_test.go index eb62b2d..63942c6 100644 --- a/divvyyaml/divvyyaml_test.go +++ b/divvyyaml/divvyyaml_test.go @@ -7,18 +7,21 @@ import ( ) func TestCorrectParse(t *testing.T) { - k8s_good, err := ioutil.ReadFile("../examples/k8s_deployment_output.yaml") - cfn_good, err := ioutil.ReadFile("../examples/cloudformation_ec2_output.yaml") + k8sGood, err := ioutil.ReadFile("../examples/k8s_deployment_output.yaml") + if err != nil { + t.Fatalf("Could not load test data: %v", err) + } + cfnGood, err := ioutil.ReadFile("../examples/cloudformation_ec2_output.yaml") if err != nil { t.Fatalf("Could not load test data: %v", err) } t.Run("k8s", func(t *testing.T) { - compareDocuments(t, "../examples/k8s_deployment", k8s_good) + compareDocuments(t, "../examples/k8s_deployment", k8sGood) }) t.Run("cfn", func(t *testing.T) { - compareDocuments(t, "../examples/cloudformation_ec2", cfn_good) + compareDocuments(t, "../examples/cloudformation_ec2", cfnGood) }) }