Skip to content

Commit

Permalink
linting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
GoesToEleven committed Nov 26, 2015
1 parent e443987 commit 0ca46d6
Show file tree
Hide file tree
Showing 122 changed files with 294 additions and 305 deletions.
2 changes: 1 addition & 1 deletion 01_getting-started/01_helloWorld/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import "fmt"

func main() {
fmt.Println("Hello world!")
}
}
1 change: 1 addition & 0 deletions 02_package/stringutil/name.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package stringutil

// MyName will be exported because it starts with a capital letter.
var MyName = "Todd"
2 changes: 1 addition & 1 deletion 03_variables/03_less-emphasis/03_init-many-at-once/var.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "fmt"

func main() {

var message string = "Hello World!"
var message = "Hello World!"
var a, b, c int = 1, 2, 3

fmt.Println(message, a, b, c)
Expand Down
4 changes: 2 additions & 2 deletions 03_variables/03_less-emphasis/07_all-together/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package main

import "fmt"

var a string = "this is stored in the variable a" // package scope
var a = "this is stored in the variable a" // package scope
var b, c string = "stored in b", "stored in c" // package scope
var d string // package scope

func main() {

d = "stored in d" // declaration above; assignment here; package scope
var e int = 42 // function scope - subsequent variables have same package scope:
var e = 42 // function scope - subsequent variables have same package scope:
f := 43
g := "stored in g"
h, i := "stored in h", "stored in i"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import "fmt"

var name string = "Todd"
var name = "Todd"

func main() {
fmt.Println("Hello ", name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ package main
import "fmt"

func main() {
var name string = "Todd"
var name = "Todd"
fmt.Println("Hello ", name)
}
2 changes: 1 addition & 1 deletion 04_scope/01_package-scope/01/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import "fmt"

var x int = 42
var x = 42

func main() {
fmt.Println(x)
Expand Down
2 changes: 1 addition & 1 deletion 04_scope/01_package-scope/02_visibility/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"github.com/GoesToEleven/GolangTraining/04_scope/01_package-scope/02_visibility/vis"
"github.com/goestoeleven/GolangTraining/04_scope/01_package-scope/02_visibility/vis"
)

func main() {
Expand Down
1 change: 1 addition & 0 deletions 04_scope/01_package-scope/02_visibility/vis/name.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package vis

// MyName is exported because it starts with a capital letter
var MyName = "Todd"
var yourName = "Future Rock Star Programmer"
1 change: 1 addition & 0 deletions 04_scope/01_package-scope/02_visibility/vis/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package vis

import "fmt"

// PrintVar is exported because it starts with a capital letter
func PrintVar() {
fmt.Println(MyName)
fmt.Println(yourName)
Expand Down
2 changes: 1 addition & 1 deletion 06_constants/01_constant/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import "fmt"

const p string = "death & taxes"
const p = "death & taxes"

func main() {

Expand Down
8 changes: 4 additions & 4 deletions 06_constants/02_multiple-initialization/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package main
import "fmt"

const (
PI = 3.14
Language = "Go"
pi = 3.14
language = "Go"
)

func main() {
fmt.Println(PI)
fmt.Println(Language)
fmt.Println(pi)
fmt.Println(language)
}
12 changes: 6 additions & 6 deletions 06_constants/03_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package main
import "fmt"

const (
A = iota // 0
B = iota // 1
C = iota // 2
a = iota // 0
b = iota // 1
c = iota // 2
)

func main() {
fmt.Println(A)
fmt.Println(B)
fmt.Println(C)
fmt.Println(a)
fmt.Println(b)
fmt.Println(c)
}
12 changes: 6 additions & 6 deletions 06_constants/04_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package main
import "fmt"

const (
A = iota // 0
B // 1
C // 2
a = iota // 0
b // 1
c // 2
)

func main() {
fmt.Println(A)
fmt.Println(B)
fmt.Println(C)
fmt.Println(a)
fmt.Println(b)
fmt.Println(c)
}
24 changes: 12 additions & 12 deletions 06_constants/05_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ package main
import "fmt"

const (
A = iota // 0
B // 1
C // 2
a = iota // 0
b // 1
c // 2
)

const (
D = iota // 0
E // 1
F // 2
d = iota // 0
e // 1
f // 2
)

func main() {
fmt.Println(A)
fmt.Println(B)
fmt.Println(C)
fmt.Println(D)
fmt.Println(E)
fmt.Println(F)
fmt.Println(a)
fmt.Println(b)
fmt.Println(c)
fmt.Println(d)
fmt.Println(e)
fmt.Println(f)
}
8 changes: 4 additions & 4 deletions 06_constants/06_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import "fmt"

const (
_ = iota // 0
B = iota * 10 // 1 * 10
C = iota * 10 // 2 * 10
b = iota * 10 // 1 * 10
c = iota * 10 // 2 * 10
)

func main() {
fmt.Println(B)
fmt.Println(C)
fmt.Println(b)
fmt.Println(c)
}
2 changes: 1 addition & 1 deletion 100_GDGSV/in-progress/02_concurrency/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func getImages(dir string) [][]pixel {
return nil
}

go (func(){
go (func() {
img := loadImage(path)
pixels := getPixels(img)
images = append(images, pixels)
Expand Down
10 changes: 5 additions & 5 deletions 100_GDGSV/in-progress/04_mutex/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"fmt"
"image"
"image/jpeg"
"io/ioutil"
"log"
"os"
"path/filepath"
"time"
"sync"
"io/ioutil"
"time"
)

var counter int
Expand All @@ -23,9 +23,9 @@ type pixel struct {
func main() {
start := time.Now()
dir := "../photos/"
files,_ := ioutil.ReadDir(dir)
files, _ := ioutil.ReadDir(dir)
wg.Add(len(files))
fmt.Println("FILES TO PROCESS:",len(files))
fmt.Println("FILES TO PROCESS:", len(files))
images := getImages(dir)

// range over the [] holding the []pixel - eg, give me each img
Expand All @@ -52,7 +52,7 @@ func getImages(dir string) [][]pixel {
return nil
}

go (func(){
go (func() {
img := loadImage(path)
pixels := getPixels(img)
mutex.Lock()
Expand Down
2 changes: 1 addition & 1 deletion 13_exercise-solutions/04_user-enters-numbers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ func main() {
fmt.Scan(&numOne)
fmt.Print("Please enter a smaller number: ")
fmt.Scan(&numTwo)
fmt.Println(numOne, "/", numTwo, " = ", numOne / numTwo)
fmt.Println(numOne, "/", numTwo, " = ", numOne/numTwo)
}
2 changes: 1 addition & 1 deletion 13_exercise-solutions/05_even-numbers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import "fmt"

func main() {
for i := 0; i <=100; i++ {
for i := 0; i <= 100; i++ {
if i%2 == 0 {
fmt.Println(i)
}
Expand Down
2 changes: 1 addition & 1 deletion 14_functions/03_two-params/02/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ func main() {

func greet(fname, lname string) {
fmt.Println(fname, lname)
}
}
2 changes: 1 addition & 1 deletion 14_functions/13_recursion/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ func factorial(x int) int {

func main() {
fmt.Println(factorial(4))
}
}
2 changes: 1 addition & 1 deletion 16_exercise-solutions/05_params-and-args/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ func main() {

func foo(numbers ...int) {
fmt.Println(numbers)
}
}
2 changes: 1 addition & 1 deletion 18_slice/02_int-slice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ func main() {
fmt.Println(i, " - ", value)
}

}
}
2 changes: 1 addition & 1 deletion 19_map/01_var_nil-map/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ func main() {
myGreeting["Jenny"] = "Bonjour."
*/
// and you will get this:
// panic: assignment to entry in nil map
// panic: assignment to entry in nil map
2 changes: 1 addition & 1 deletion 19_map/02_var_make/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ func main() {
myGreeting["Jenny"] = "Bonjour."

fmt.Println(myGreeting)
}
}
2 changes: 1 addition & 1 deletion 19_map/03_shorthand_make/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ func main() {
myGreeting["Jenny"] = "Bonjour."

fmt.Println(myGreeting)
}
}
2 changes: 1 addition & 1 deletion 19_map/04_shorthand_composite-literal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ func main() {
myGreeting["Jenny"] = "Bonjour."

fmt.Println(myGreeting)
}
}
4 changes: 2 additions & 2 deletions 19_map/05_shorthand_composite-literal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import "fmt"
func main() {

myGreeting := map[string]string{
"Tim": "Good morning!",
"Jenny": "Bonjour!",
"Tim": "Good morning!",
"Jenny": "Bonjour!",
}

fmt.Println(myGreeting["Jenny"])
Expand Down
4 changes: 2 additions & 2 deletions 19_map/06_adding-entry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import "fmt"
func main() {

myGreeting := map[string]string{
"Tim": "Good morning!",
"Jenny": "Bonjour!",
"Tim": "Good morning!",
"Jenny": "Bonjour!",
}

myGreeting["Harleen"] = "Howdy"
Expand Down
4 changes: 2 additions & 2 deletions 19_map/07_len/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import "fmt"
func main() {

myGreeting := map[string]string{
"Tim": "Good morning!",
"Jenny": "Bonjour!",
"Tim": "Good morning!",
"Jenny": "Bonjour!",
}

myGreeting["Harleen"] = "Howdy"
Expand Down
4 changes: 2 additions & 2 deletions 19_map/08_updating-entry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import "fmt"
func main() {

myGreeting := map[string]string{
"Tim": "Good morning!",
"Jenny": "Bonjour!",
"Tim": "Good morning!",
"Jenny": "Bonjour!",
}

myGreeting["Harleen"] = "Howdy"
Expand Down
6 changes: 3 additions & 3 deletions 19_map/09_deleting-entry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import "fmt"
func main() {

myGreeting := map[string]string{
"zero": "Good morning!",
"one": "Bonjour!",
"two": "Buenos dias!",
"zero": "Good morning!",
"one": "Bonjour!",
"two": "Buenos dias!",
"three": "Bongiorno!",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import "fmt"

func main() {
for i := 65; i <= 122; i++ {
fmt.Println(i, " - ", string(i), " - ", i % 12)
fmt.Println(i, " - ", string(i), " - ", i%12)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
}

func HashBucket(word string, buckets int) int {
letter := int(word[0])
bucket := letter % buckets
return bucket
}
letter := int(word[0])
bucket := letter % buckets
return bucket
}
Loading

0 comments on commit 0ca46d6

Please sign in to comment.