Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nlowe committed Dec 2, 2018
1 parent 0b0d4c7 commit 3b3fc76
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Advent of Code 2018

[![Build Status](https://travis-ci.org/nlowe/aoc2018.svg?branch=master)](https://travis-ci.org/nlowe/aoc2018) [![Coverage Status](https://coveralls.io/repos/github/nlowe/aoc2018/badge.svg?branch=master)](https://coveralls.io/github/nlowe/aoc2018?branch=master)
[![Build Status](https://travis-ci.org/nlowe/aoc2018.svg?branch=master)](https://travis-ci.org/nlowe/aoc2018) [![Coverage Status](https://coveralls.io/repos/github/nlowe/aoc2018/badge.svg?branch=master)](https://coveralls.io/github/nlowe/aoc2018?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/nlowe/aoc2018)](https://goreportcard.com/report/github.com/nlowe/aoc2018)

Solutions for the 2018 Advent of Code

Expand Down
7 changes: 4 additions & 3 deletions day1/a/a.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package main

import (
"fmt"
"github.com/nlowe/aoc2018/util"
"strconv"
"strings"

"github.com/nlowe/aoc2018/util"
)

func main() {
fmt.Printf( "Answer: %d", a(util.ReadInput()))
fmt.Printf("Answer: %d", a(util.ReadInput()))
}

func a(input *util.ChallengeInput) int {
Expand All @@ -29,4 +30,4 @@ func a(input *util.ChallengeInput) int {
}

return frequency
}
}
5 changes: 3 additions & 2 deletions day1/a/a_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"testing"

"github.com/nlowe/aoc2018/util"
"github.com/stretchr/testify/assert"
"testing"
)

func TestA_ExampleA(t *testing.T) {
Expand Down Expand Up @@ -31,4 +32,4 @@ func TestA_ExampleC(t *testing.T) {
`)

assert.Equal(t, -6, a(input))
}
}
3 changes: 2 additions & 1 deletion day1/b/b.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package main

import (
"fmt"
"github.com/nlowe/aoc2018/util"
"strconv"
"strings"

"github.com/nlowe/aoc2018/util"
)

func main() {
Expand Down
5 changes: 3 additions & 2 deletions day1/b/b_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"testing"

"github.com/nlowe/aoc2018/util"
"github.com/stretchr/testify/assert"
"testing"
)

func TestB_ExampleA(t *testing.T) {
Expand Down Expand Up @@ -41,4 +42,4 @@ func TestB_ExampleD(t *testing.T) {
-4`)

assert.Equal(t, 14, b(input))
}
}
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ module github.com/nlowe/aoc2018
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.1.1 // indirect
github.com/stretchr/testify v1.2.2
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
6 changes: 3 additions & 3 deletions util/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func newInputFromReader(r io.Reader, c io.Closer) *ChallengeInput {

result.lines = make(chan string)

go func(){
defer func(){
go func() {
defer func() {
if c != nil {
c.Close()
}
Expand All @@ -57,4 +57,4 @@ func newInputFromReader(r io.Reader, c io.Closer) *ChallengeInput {

func (c *ChallengeInput) Lines() <-chan string {
return c.lines
}
}

0 comments on commit 3b3fc76

Please sign in to comment.