...

Source file src/github.com/thlib/go-timezone-local/tzlocal/cmd/update_tzmapping.go

Documentation: github.com/thlib/go-timezone-local/tzlocal/cmd

     1  package main
     2  
     3  import (
     4  	"os"
     5  	"path/filepath"
     6  
     7  	"github.com/thlib/go-timezone-local/tzdata"
     8  )
     9  
    10  func main() {
    11  	path, _ := filepath.Abs("./tzmapping.go")
    12  	f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755)
    13  	if err != nil {
    14  		panic(err)
    15  	}
    16  	defer f.Close()
    17  	_, err = f.WriteString("// Code generated by tzlocal/update_tzmapping.go DO NOT EDIT.\n")
    18  	if err != nil {
    19  		panic(err)
    20  	}
    21  	_, err = f.WriteString("package tzlocal\n\n")
    22  	if err != nil {
    23  		panic(err)
    24  	}
    25  	tzdata.UpdateWindowsTZMapping(f)
    26  }
    27  

View as plain text