Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove underscore from package name and some variables #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion about_allocation.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutAllocation() {
a := new(int)
Expand Down
2 changes: 1 addition & 1 deletion about_anonymous_functions.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutAnonymousFunctions() {
{
Expand Down
14 changes: 7 additions & 7 deletions about_arrays.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutArrays() {
fruits := [4]string{"apple", "orange", "mango"}
Expand All @@ -13,14 +13,14 @@ func aboutArrays() {

assert(fruits == [4]string{}) // comparing arrays is not like comparing apples and oranges

tasty_fruits := fruits[1:3] // defining oneself as a variation of another
assert(tasty_fruits[0] == __string__) // slices of arrays share some data
assert(tasty_fruits[1] == __string__) // albeit slightly askewed
tastyFruits := fruits[1:3] // defining oneself as a variation of another
assert(tastyFruits[0] == __string__) // slices of arrays share some data
assert(tastyFruits[1] == __string__) // albeit slightly askewed

assert(len(tasty_fruits) == __int__) // its length is manifest
assert(cap(tasty_fruits) == __int__) // but its capacity is surprising!
assert(len(tastyFruits) == __int__) // its length is manifest
assert(cap(tastyFruits) == __int__) // but its capacity is surprising!

tasty_fruits[0] = "lemon" // are their shared roots truly identical?
tastyFruits[0] = "lemon" // are their shared roots truly identical?

assert(fruits[0] == __string__) // has this element remained the same?
assert(fruits[1] == __string__) // how about the second?
Expand Down
2 changes: 1 addition & 1 deletion about_basics.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutBasics() {
assert(__bool__ == true) // what is truth?
Expand Down
2 changes: 1 addition & 1 deletion about_channels.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutChannels() {
ch := make(chan string, 2)
Expand Down
2 changes: 1 addition & 1 deletion about_common_interfaces.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

import "bytes"

Expand Down
2 changes: 1 addition & 1 deletion about_concurrency.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func isPrimeNumber(possiblePrime int) bool {
for underPrime := 2; underPrime < possiblePrime; underPrime++ {
Expand Down
2 changes: 1 addition & 1 deletion about_control_flow.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

import "fmt"

Expand Down
2 changes: 1 addition & 1 deletion about_enumeration.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutEnumeration() {
{
Expand Down
2 changes: 1 addition & 1 deletion about_files.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

import "io/ioutil"
import "strings"
Expand Down
2 changes: 1 addition & 1 deletion about_interfaces.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutInterfaces() {
bob := new(human) // bob is a kind of *human
Expand Down
2 changes: 1 addition & 1 deletion about_maps.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutMaps() {
ages := map[string]int{
Expand Down
2 changes: 1 addition & 1 deletion about_panics.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func divideFourBy(i int) int {
return 4 / i
Expand Down
2 changes: 1 addition & 1 deletion about_pointers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutPointers() {
{
Expand Down
22 changes: 11 additions & 11 deletions about_slices.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package go_koans
package gokoans

func aboutSlices() {
fruits := []string{"apple", "orange", "mango"}

assert(fruits[0] == __string__) // slices seem like arrays
assert(len(fruits) == __int__) // in nearly all respects

tasty_fruits := fruits[1:3] // we can even slice slices
assert(tasty_fruits[0] == __string__) // slices of slices also share the underlying data
tastyFruits := fruits[1:3] // we can even slice slices
assert(tastyFruits[0] == __string__) // slices of slices also share the underlying data

pregnancy_slots := []string{"baby", "baby", "lemon"}
assert(cap(pregnancy_slots) == __int__) // the capacity is initially the length
pregnancySlots := []string{"baby", "baby", "lemon"}
assert(cap(pregnancySlots) == __int__) // the capacity is initially the length

pregnancy_slots = append(pregnancy_slots, "baby!")
assert(len(pregnancy_slots) == __int__) // slices can be extended with append(), much like realloc in C
assert(cap(pregnancy_slots) == __int__) // but with better optimizations
pregnancySlots = append(pregnancySlots, "baby!")
assert(len(pregnancySlots) == __int__) // slices can be extended with append(), much like realloc in C
assert(cap(pregnancySlots) == __int__) // but with better optimizations

pregnancy_slots = append(pregnancy_slots, "another baby!?", "yet another, oh dear!", "they must be Catholic")
pregnancySlots = append(pregnancySlots, "another baby!?", "yet another, oh dear!", "they must be Catholic")

assert(len(pregnancy_slots) == __int__) // append() can take N arguments to append to the slice
assert(cap(pregnancy_slots) == __int__) // the capacity optimizations have a guessable algorithm
assert(len(pregnancySlots) == __int__) // append() can take N arguments to append to the slice
assert(cap(pregnancySlots) == __int__) // the capacity optimizations have a guessable algorithm
}
2 changes: 1 addition & 1 deletion about_strings.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

import "fmt"

Expand Down
2 changes: 1 addition & 1 deletion about_structs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

func aboutStructs() {
var bob struct {
Expand Down
2 changes: 1 addition & 1 deletion about_types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

type coolNumber int

Expand Down
2 changes: 1 addition & 1 deletion about_variadic_functions.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

import "strings"

Expand Down
2 changes: 1 addition & 1 deletion setup_koans_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package go_koans
package gokoans

import (
"fmt"
Expand Down