Skip to content

Instantly share code, notes, and snippets.

Avatar

adilw3nomad adilw3nomad

  • Somewhere
View GitHub Profile
View GopherGymPart1.2.go
package main
import (
"bufio"
"encoding/csv"
"fmt"
"log"
"os"
)
View GopherGymPart1.3.go
package main
import (
"bufio"
"encoding/csv"
"fmt"
"log"
"os"
)
View GopherGymPart1.4.go
package main
import (
"bufio"
"encoding/csv"
"fmt"
"log"
"os"
)
View GopherGymPart1.5.go
package main
import (
"bufio"
"encoding/csv"
"fmt"
"log"
"os"
"strings"
)
View GopherGymPart1.6.go
package main
import (
"bufio"
"encoding/csv"
"fmt"
"io"
"log"
"os"
"strings"
View GopherGymPart1.1.go
package main
import (
"encoding/csv"
"fmt"
"log"
"os"
)
func main() {
View block1.
go
package main
import (
"bufio"
"encoding/csv"
"fmt"
"log"
"os"
"strings"
View block2.
go
package main
import “testing”
func TestCompareAnswer(t *testing.T) {
got := CompareAnswer(“3”, “3”)
if got != true {
t.Errorf(“CompareAnswer = %v; want true”, got)
}
View block3.
go
func TestCheckAnswer(t *testing.T) {
got := CheckAnswer(“3”, “3”)
if got != true {
t.Errorf(“CheckAnswer = %v; want true”, got)
}
}
View block4.
go
func TestCheckAnswer(t *testing.T) {
gotCorrect := CheckAnswer(“3”, “3”)
if gotCorrect != “Correct! Well done” {
t.Errorf(“CheckAnswer = %v; want ‘Correct! Well Done’”, gotCorrect)
}
gotIncorrect := CheckAnswer(“3”, “2”)
if gotIncorrect != “WRONG! Answer is: 2” {
t.Errorf(“CheckAnswer = %v; want ‘WRONG! Answer is: 2’”, gotIncorrect)
}