From 5db7c0ad3e36db5d0bc82b23cec06d240b8ee75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbjo=CC=88rn=20Einarsson?= Date: Tue, 12 Nov 2024 12:19:27 +0100 Subject: [PATCH] change: move GetVersion() from mp4 to internal --- cmd/mp4ff-crop/main.go | 3 ++- cmd/mp4ff-decrypt/main.go | 3 ++- cmd/mp4ff-encrypt/main.go | 3 ++- cmd/mp4ff-info/main.go | 3 ++- cmd/mp4ff-nallister/main.go | 3 ++- cmd/mp4ff-pslister/main.go | 3 ++- cmd/mp4ff-subslister/main.go | 3 ++- examples/add-sidx/main.go | 3 ++- {mp4 => internal}/version.go | 4 ++-- {mp4 => internal}/version_test.go | 4 ++-- 10 files changed, 20 insertions(+), 12 deletions(-) rename {mp4 => internal}/version.go (85%) rename {mp4 => internal}/version_test.go (57%) diff --git a/cmd/mp4ff-crop/main.go b/cmd/mp4ff-crop/main.go index 3283743d..7da34b6f 100644 --- a/cmd/mp4ff-crop/main.go +++ b/cmd/mp4ff-crop/main.go @@ -8,6 +8,7 @@ import ( "os" "sort" + "github.com/Eyevinn/mp4ff/internal" "github.com/Eyevinn/mp4ff/mp4" ) @@ -62,7 +63,7 @@ func run(args []string, stdout io.Writer) error { } if o.version { - fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion()) + fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion()) return nil } diff --git a/cmd/mp4ff-decrypt/main.go b/cmd/mp4ff-decrypt/main.go index 7c7ed7ab..49af9d8f 100644 --- a/cmd/mp4ff-decrypt/main.go +++ b/cmd/mp4ff-decrypt/main.go @@ -8,6 +8,7 @@ import ( "io" "os" + "github.com/Eyevinn/mp4ff/internal" "github.com/Eyevinn/mp4ff/mp4" ) @@ -61,7 +62,7 @@ func run(args []string) error { } if opts.version { - fmt.Printf("%s %s\n", appName, mp4.GetVersion()) + fmt.Printf("%s %s\n", appName, internal.GetVersion()) return nil } diff --git a/cmd/mp4ff-encrypt/main.go b/cmd/mp4ff-encrypt/main.go index 8918bb7b..01578b6f 100644 --- a/cmd/mp4ff-encrypt/main.go +++ b/cmd/mp4ff-encrypt/main.go @@ -8,6 +8,7 @@ import ( "io" "os" + "github.com/Eyevinn/mp4ff/internal" "github.com/Eyevinn/mp4ff/mp4" ) @@ -72,7 +73,7 @@ func run(args []string) error { } if opts.version { - fmt.Printf("%s %s\n", appName, mp4.GetVersion()) + fmt.Printf("%s %s\n", appName, internal.GetVersion()) return nil } diff --git a/cmd/mp4ff-info/main.go b/cmd/mp4ff-info/main.go index 6d84ed4e..b3ac6797 100644 --- a/cmd/mp4ff-info/main.go +++ b/cmd/mp4ff-info/main.go @@ -7,6 +7,7 @@ import ( "io" "os" + "github.com/Eyevinn/mp4ff/internal" "github.com/Eyevinn/mp4ff/mp4" ) @@ -59,7 +60,7 @@ func run(args []string, w io.Writer) error { } if opts.version { - fmt.Printf("%s %s\n", appName, mp4.GetVersion()) + fmt.Printf("%s %s\n", appName, internal.GetVersion()) return nil } diff --git a/cmd/mp4ff-nallister/main.go b/cmd/mp4ff-nallister/main.go index a74157fb..48175377 100644 --- a/cmd/mp4ff-nallister/main.go +++ b/cmd/mp4ff-nallister/main.go @@ -11,6 +11,7 @@ import ( "github.com/Eyevinn/mp4ff/avc" "github.com/Eyevinn/mp4ff/hevc" + "github.com/Eyevinn/mp4ff/internal" "github.com/Eyevinn/mp4ff/mp4" "github.com/Eyevinn/mp4ff/sei" ) @@ -80,7 +81,7 @@ func run(args []string, stdout io.Writer) error { } if o.version { - fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion()) + fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion()) return nil } diff --git a/cmd/mp4ff-pslister/main.go b/cmd/mp4ff-pslister/main.go index 3a90c09d..bfd87dd1 100644 --- a/cmd/mp4ff-pslister/main.go +++ b/cmd/mp4ff-pslister/main.go @@ -12,6 +12,7 @@ import ( "github.com/Eyevinn/mp4ff/avc" "github.com/Eyevinn/mp4ff/hevc" + "github.com/Eyevinn/mp4ff/internal" "github.com/Eyevinn/mp4ff/mp4" ) @@ -75,7 +76,7 @@ func run(args []string, stdout io.Writer) error { } if o.version { - fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion()) + fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion()) return nil } diff --git a/cmd/mp4ff-subslister/main.go b/cmd/mp4ff-subslister/main.go index f06a14d0..45771aec 100644 --- a/cmd/mp4ff-subslister/main.go +++ b/cmd/mp4ff-subslister/main.go @@ -8,6 +8,7 @@ import ( "io" "os" + "github.com/Eyevinn/mp4ff/internal" "github.com/Eyevinn/mp4ff/mp4" ) @@ -64,7 +65,7 @@ func run(args []string, stdout io.Writer) error { } if o.version { - fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion()) + fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion()) return nil } diff --git a/examples/add-sidx/main.go b/examples/add-sidx/main.go index 082316e1..d509d9a5 100644 --- a/examples/add-sidx/main.go +++ b/examples/add-sidx/main.go @@ -7,6 +7,7 @@ import ( "io" "os" + "github.com/Eyevinn/mp4ff/internal" "github.com/Eyevinn/mp4ff/mp4" ) @@ -67,7 +68,7 @@ func run(args []string, stdout io.Writer) error { } if o.version { - fmt.Fprintf(stdout, "%s %s\n", appName, mp4.GetVersion()) + fmt.Fprintf(stdout, "%s %s\n", appName, internal.GetVersion()) return nil } diff --git a/mp4/version.go b/internal/version.go similarity index 85% rename from mp4/version.go rename to internal/version.go index 98755f6b..9814f429 100644 --- a/mp4/version.go +++ b/internal/version.go @@ -1,4 +1,4 @@ -package mp4 +package internal import ( "fmt" @@ -8,7 +8,7 @@ import ( var ( commitVersion string = "v0.46" // May be updated using build flags - commitDate string = "1723143113" // commitDate in Epoch seconds (may be overridden using build flags) + commitDate string = "1731409630" // commitDate in Epoch seconds (may be overridden using build flags) ) // GetVersion - get version and also commitHash and commitDate if inserted via Makefile diff --git a/mp4/version_test.go b/internal/version_test.go similarity index 57% rename from mp4/version_test.go rename to internal/version_test.go index 26dd3949..41e3189c 100644 --- a/mp4/version_test.go +++ b/internal/version_test.go @@ -1,8 +1,8 @@ -package mp4 +package internal import "fmt" func ExampleGetVersion() { fmt.Println(GetVersion()) - // Output: v0.46, date: 2024-08-08 + // Output: v0.46, date: 2024-11-12 }