fix(models): ensure unique GUIDs in InitTable function

This commit is contained in:
Hein
2026-10-05 17:29:23 +02:00
parent d26d720e93
commit 636e25851e
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -243,7 +243,7 @@ release: lint fmt-check test build ## Run lint, format check, tests, build, then
git push origin "$$version"; \ git push origin "$$version"; \
echo "Tag $$version created and pushed to remote repository." echo "Tag $$version created and pushed to remote repository."
release-version: lint fmt-check ## Run lint and format check, then auto-increment patch version, update VERSION/package files, commit, tag, and push release-version: lint fmt-check staticcheck ## Run lint, format check and staticcheck, then auto-increment patch version, update VERSION/package files, commit, tag, and push
@CURRENT=$$([ -f VERSION ] && cat VERSION | tr -d '[:space:]' || (git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//') || echo "0.0.0"); \ @CURRENT=$$([ -f VERSION ] && cat VERSION | tr -d '[:space:]' || (git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//') || echo "0.0.0"); \
MAJOR=$$(echo $$CURRENT | cut -d. -f1); \ MAJOR=$$(echo $$CURRENT | cut -d. -f1); \
MINOR=$$(echo $$CURRENT | cut -d. -f2); \ MINOR=$$(echo $$CURRENT | cut -d. -f2); \
+2 -1
View File
@@ -226,7 +226,8 @@ func TestInitConstructors(t *testing.T) {
} }
// GUIDs are unique per call. // GUIDs are unique per call.
if InitTable("t", "s").GUID == InitTable("t", "s").GUID { t1, t2 := InitTable("t", "s"), InitTable("t", "s")
if t1.GUID == t2.GUID {
t.Error("GUIDs must be unique") t.Error("GUIDs must be unique")
} }
} }