This file contains 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 ( | |
"bufio" | |
"net/http" | |
"os" | |
"fmt" | |
) | |
type Url struct { |
This file contains 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 models | |
type Channel struct { | |
UserID string `json:"user_id" bson:"user_id"` | |
OrganizationID string `json:"org_id" bson:"org_id"` | |
ApplicationID string `json:"app_id" bson:"app_id"` | |
ChannelData interface{} `json:"channel_data" bson:"channel_data"` | |
Ident string `json:"ident" bson:"ident"` | |
} |
This file contains 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" | |
"reflect" | |
) | |
func main() { | |
r := genericMap([]int{1, 2, 3, 4}, func(x int) string { | |
return "Hello" |
This file contains 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 predicate func(int) bool | |
func main() { | |
r := filter([]int{1, 2, 3, 4}, func(x int) bool { | |
return x%2 == 0 | |
}) |
This file contains 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
'use strict'; | |
var chai = require('chai'); | |
var expect = chai.expect; | |
describe('Array', function() { | |
describe('#indexOf()', function () { | |
it('should return -1 when the value is not present', function () { | |
expect([1,2,3].indexOf(5)).to.equal(-1); |
This file contains 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 ( | |
"shared" //Path to the package contains shared struct | |
) | |
// Every method that we want to export must have | |
// (1) the method has two arguments, both exported (or builtin) types | |
// (2) the method's second argument is a pointer | |
// (3) the method has return type error |
This file contains 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 shared | |
type Arith interface { | |
Multiply(args *Args, reply *int) error | |
Divide(args *Args, quo *Quotient) error | |
} |
This file contains 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" | |
"log" | |
"net" | |
"net/rpc" | |
"shared" //Path to the package contains shared struct | |
) |
This file contains 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" | |
"log" | |
"net" | |
"net/rpc" | |
"shared" //Path to the package contains shared struct | |
) |
OlderNewer