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 notifier | |
import "fmt" | |
type notifier struct { | |
name *string | |
id int | |
counter int | |
} |
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 notifier | |
import "fmt" | |
type notifier struct { | |
name string | |
id int | |
counter int | |
} |
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 notifier | |
import "fmt" | |
type notifier struct { | |
name string | |
id int | |
} | |
func (n *notifier) notify() { |
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 notifier | |
import "fmt" | |
type notifier struct { | |
name string | |
id int | |
} |
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
func Test_intInSlice(t *testing.T) { | |
type args struct { | |
a int | |
list []int | |
} | |
tests := []struct { | |
name string | |
args args | |
want 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 intIntSlice | |
import "testing" | |
func Test_intInSlice(t *testing.T) { | |
type args struct { | |
a int | |
list []int | |
} | |
tests := []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 intIntSlice | |
func intInSlice(a int, list []int) bool { | |
for _, b := range list { | |
if b == a { | |
return true | |
} | |
} | |
return false | |
} |
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 Holiday []struct { | |
Date string `json:"date"` | |
LocalName string `json:"localName"` | |
Name string `json:"name"` | |
CountryCode string `json:"countryCode"` | |
Fixed bool `json:"fixed"` | |
Global bool `json:"global"` | |
Counties interface{} `json:"counties"` | |
LaunchYear interface{} `json:"launchYear"` |
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
[ | |
{ | |
"date": "2020-01-01", | |
"localName": "New Year's Day", | |
"name": "New Year's Day", | |
"countryCode": "US", | |
"fixed": false, | |
"global": true, | |
"counties": null, | |
"launchYear": null, |
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
func printPayload(){ | |
url := "https://date.nager.at/api/v2/publicholidays/2020/US" | |
data,_ := http.Get(url) | |
payload,_ := ioutil.ReadAll(data.Body) | |
fmt.Println(string(payload)) | |
} |
NewerOlder