-
-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathversion.go
More file actions
56 lines (44 loc) · 1.08 KB
/
Copy pathversion.go
File metadata and controls
56 lines (44 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2025-2026 lin-snow
package version
import (
"fmt"
"time"
)
const (
Version = "5.7.0"
// License is the SPDX identifier of the project license.
License = "AGPL-3.0-or-later"
Author = "L1nSn0w"
RepoURL = "https://github.com/lin-snow/Ech0"
StartYear = 2025
)
var Commit = "unknown"
var BuildTime = ""
type Info struct {
Version string `json:"version"`
Commit string `json:"commit"`
BuildTime string `json:"build_time"`
License string `json:"license"`
Author string `json:"author"`
RepoURL string `json:"repo_url"`
}
func Get() Info {
return Info{
Version: Version,
Commit: Commit,
BuildTime: BuildTime,
License: License,
Author: Author,
RepoURL: RepoURL,
}
}
// Copyright returns the human-readable copyright line, e.g.
// "Copyright (C) 2025-2026 lin-snow".
func Copyright() string {
end := time.Now().UTC().Year()
if end <= StartYear {
return fmt.Sprintf("Copyright (C) %d %s", StartYear, Author)
}
return fmt.Sprintf("Copyright (C) %d-%d %s", StartYear, end, Author)
}