From fac100ff37dfbeecf5c384b0ff7860ae041d1b17 Mon Sep 17 00:00:00 2001 From: hamidreza abedi Date: Sun, 9 Jun 2024 12:00:38 +0330 Subject: [PATCH 1/2] feat(validation): add `Label` to error struct --- core/validation/validation.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/validation/validation.go b/core/validation/validation.go index 33d466fa..c7527334 100644 --- a/core/validation/validation.go +++ b/core/validation/validation.go @@ -58,9 +58,9 @@ type ValidFormer interface { // Error show the error type Error struct { - Message, Key, Name, Field, Tmpl string - Value interface{} - LimitValue interface{} + Message, Key, Name, Field, Tmpl, Label string + Value interface{} + LimitValue interface{} } // String Returns the Message. @@ -292,6 +292,7 @@ func (v *Validation) apply(chk Validator, obj interface{}) *Result { Value: obj, Tmpl: MessageTmpls[Name], LimitValue: chk.GetLimitValue(), + Label: Label, } v.setError(err) @@ -324,6 +325,7 @@ func (v *Validation) AddError(key, message string) { Key: key, Name: Name, Field: Field, + Label: Label, } v.setError(err) } From dc77027b809572fbf2679b9d420eb926c6cfd0d6 Mon Sep 17 00:00:00 2001 From: Deng Ming Date: Mon, 1 Jul 2024 18:48:08 +0800 Subject: [PATCH 2/2] using tsl0922/ssdb as test image --- .github/workflows/test.yml | 6 ++++-- scripts/test_docker_compose.yaml | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 46bc04c9..af6484f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,9 +40,11 @@ jobs: ports: - 11211:11211 ssdb: - image: wendal/ssdb:latest + image: tsl0922/ssdb + env: + SSDB_PORT: 8888 ports: - - 8888:8888 + - "8888:8888" postgres: image: postgres:latest env: diff --git a/scripts/test_docker_compose.yaml b/scripts/test_docker_compose.yaml index f22b6deb..066fdf97 100644 --- a/scripts/test_docker_compose.yaml +++ b/scripts/test_docker_compose.yaml @@ -1,4 +1,3 @@ -version: "3.8" services: redis: container_name: "beego-redis" @@ -28,7 +27,9 @@ services: - ALLOW_EMPTY_PASSWORD=yes ssdb: container_name: "beego-ssdb" - image: wendal/ssdb + image: tsl0922/ssdb + environment: + - SSDB_PORT=8888 ports: - "8888:8888" memcache: