Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
github.com/mix3/go-holiday
This module is a go port of DateTime::Holiday::Japanese
package main
import (
"fmt"
"github.com/mix3/go-holiday"
_ "github.com/mix3/go-holiday/holiday/jp"
)
func main() {
hd, err := holiday.New("jp")
if err != nil {
panic(err)
}
if hd.IsHolidayName(2014, 1, 1) {
fmt.Println("holiday")
}
if hd.IsHolidayName(2014, 1, 5) {
fmt.Println("holiday")
}
if hd.IsHoliday(2014, 1, 1) {
fmt.Println("with sunday")
}
if hd.IsHoliday(2014, 1, 5) {
fmt.Println("with sunday")
}
if name := hd.HolidayName(2014, 1, 1); name != "" {
fmt.Println(name) // 元旦
}
holidays := hd.Holidays(2014, 2015)
for year, _ := range holidays {
for md, name := range holidays[year] {
fmt.Printf("%04d-%s: %s\n", year, md, name)
}
}
}
output
holiday
with sunday
with sunday
元日
2014-05-04: みどりの日
2014-05-06: 振替休日
2014-11-23: 勤労感謝の日
2014-12-23: 天皇誕生日
2014-03-21: 春分の日
2014-04-29: 昭和の日
2014-05-05: こどもの日
.
.
.
Copyright (c) 2014 mix3. See LICENSE for details.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.