mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-19 21:45:17 +00:00
Commit from m3o/m3o action
This commit is contained in:
15
examples/holidays/countries/listCountries/main.go
Executable file
15
examples/holidays/countries/listCountries/main.go
Executable file
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// Get the list of countries that are supported by this API
|
||||
func main() {
|
||||
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := holidaysService.Countries(&holidays.CountriesRequest{})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
17
examples/holidays/list/getHolidays/main.go
Executable file
17
examples/holidays/list/getHolidays/main.go
Executable file
@@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// List the holiday dates for a given country and year
|
||||
func main() {
|
||||
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := holidaysService.List(&holidays.ListRequest{
|
||||
Year: 2022,
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
Reference in New Issue
Block a user