This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
func Div(a, b float32) (result float32, err error) { | |
if b == 0 { | |
err = errors.New("Cannot divide by zero.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
var oneDone chan bool = make(chan bool) | |
var fiveDone chan bool = make(chan bool) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
var done chan bool = make(chan bool) | |
func SecondCounter() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func SecondCounter() { | |
for i := 1; i <= 20; i++ { | |
time.Sleep(1 * time.Second) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func SecondCounter() { | |
for i := 1; i <= 20; i++ { | |
time.Sleep(1 * time.Second) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Start Pathogen for vim-gocode plugin | |
execute pathogen#infect() | |
Helptags | |
filetype plugin indent on | |
syntax on | |
set number | |
" Neocomplete Enable | |
"Note: This option must set it in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)! | |
" Disable AutoComplPop. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type Logger interface { | |
log(message string) | |
} | |
type DefaultLogger struct { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"log" | |
"os" | |
) | |
type MyFile struct { | |
*os.File |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("should call SaveOrder when click save", function() { | |
spyOn(service, "SaveOrder"); | |
var expectedArgument = { | |
id: "1", | |
items: [ | |
"item1", | |
"item2", | |
"item3" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type AcceptingAuthorizerFake struct { | |
} | |
func (fake *AcceptingAuthorizerFake) Authorize(username, password string) (bool, error) { | |
return (username == "Bob"), nil | |
} |