gitea源码

main_timezones.go 931B

1234567891011121314151617
  1. // Copyright 2025 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. //go:build windows
  4. package main
  5. // Golang has the ability to load OS's timezone data from most UNIX systems (https://github.com/golang/go/blob/master/src/time/zoneinfo_unix.go)
  6. // Even if the timezone data is missing, users could install the related packages to get it.
  7. // But on Windows, although `zoneinfo_windows.go` tries to load the timezone data from Windows registry,
  8. // some users still suffer from the issue that the timezone data is missing: https://github.com/go-gitea/gitea/issues/33235
  9. // So we import the tzdata package to make sure the timezone data is included in the binary.
  10. //
  11. // For non-Windows package builders, they could still use the "TAGS=timetzdata" to include the tzdata package in the binary.
  12. // If we decided to add the tzdata for other platforms, modify the "go:build" directive above.
  13. import _ "time/tzdata"