Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Configuration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Go
Application
Configuration
Compare revisions
v1.2.0 to v1.3.0
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
oss/libraries/go/application/configuration
Select target project
No results found
v1.3.0
Select Git revision
Swap
Target
oss/libraries/go/application/configuration
Select target project
oss/libraries/go/application/configuration
1 result
v1.2.0
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
refactor error functions
· 4e4072a8
Volker Schukai
authored
2 years ago
Signed-off-by:
Volker Schukai
<
volker.schukai@schukai.com
>
4e4072a8
Bump version to 1.3.0
· df062845
Volker Schukai
authored
2 years ago
df062845
Update changelog
· cf5f326e
Volker Schukai
authored
2 years ago
cf5f326e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CHANGELOG.md
+7
-0
7 additions, 0 deletions
CHANGELOG.md
api.go
+0
-10
0 additions, 10 deletions
api.go
error.go
+17
-7
17 additions, 7 deletions
error.go
error_test.go
+2
-0
2 additions, 0 deletions
error_test.go
release.json
+1
-1
1 addition, 1 deletion
release.json
with
27 additions
and
18 deletions
CHANGELOG.md
View file @
cf5f326e
<a
name=
"v1.3.0"
></a>
## [v1.3.0] - 2022-09-18
### Code Refactoring
-
refactor error functions
<a
name=
"v1.2.0"
></a>
## [v1.2.0] - 2022-09-18
### Changes
...
...
@@ -20,6 +26,7 @@
<a
name=
"v1.0.0"
></a>
## v1.0.0 - 2022-09-18
[
v1.3.0
]:
https://gitlab.schukai.com/oss/libraries/go/application/configuration/compare/v1.2.0...v1.3.0
[
v1.2.0
]:
https://gitlab.schukai.com/oss/libraries/go/application/configuration/compare/v1.1.0...v1.2.0
[
v1.1.0
]:
https://gitlab.schukai.com/oss/libraries/go/application/configuration/compare/v1.0.1...v1.1.0
[
v1.0.1
]:
https://gitlab.schukai.com/oss/libraries/go/application/configuration/compare/v1.0.0...v1.0.1
This diff is collapsed.
Click to expand it.
api.go
View file @
cf5f326e
...
...
@@ -37,16 +37,6 @@ func (s *setting[C]) SetMnemonic(mnemonic string) *setting[C] {
return
s
}
// Check if the setting contains errors
func
(
s
*
setting
[
C
])
HasErrors
()
bool
{
return
len
(
s
.
errors
)
>
0
}
// Get all errors
func
(
s
*
setting
[
C
])
Errors
()
[]
error
{
return
s
.
errors
}
// Config() returns the configuration
func
(
s
*
setting
[
C
])
Config
()
C
{
return
s
.
config
...
...
This diff is collapsed.
Click to expand it.
error.go
View file @
cf5f326e
...
...
@@ -5,6 +5,23 @@ import (
"reflect"
)
// ResetError is used to reset the error to nil
// After calling this function, the call HasErrors() will return false
func
(
s
*
setting
[
C
])
ResetErrors
()
*
setting
[
C
]
{
s
.
errors
=
[]
error
{}
return
s
}
// Check if the setting contains errors
func
(
s
*
setting
[
C
])
HasErrors
()
bool
{
return
len
(
s
.
errors
)
>
0
}
// Get all errors
func
(
s
*
setting
[
C
])
Errors
()
[]
error
{
return
s
.
errors
}
var
FileNameEmptyError
=
errors
.
New
(
"file name is empty"
)
var
MnemonicEmptyError
=
errors
.
New
(
"mnemonic is empty"
)
var
NoFileImportedError
=
errors
.
New
(
"no file imported"
)
...
...
@@ -49,13 +66,6 @@ func newUnsupportedTypeError(t reflect.Type) UnsupportedTypeError {
return
UnsupportedTypeError
(
errors
.
New
(
"type "
+
t
.
String
()
+
" is not supported"
))
}
// ResetError is used to reset the error to nil
// After calling this function, the call HasErrors() will return false
func
(
s
*
setting
[
C
])
ResetErrors
()
*
setting
[
C
]
{
s
.
errors
=
[]
error
{}
return
s
}
// At the reflect level, some types are not supported
type
UnsupportedReflectKindError
error
...
...
This diff is collapsed.
Click to expand it.
error_test.go
View file @
cf5f326e
...
...
@@ -19,6 +19,8 @@ func TestResetErrors(t *testing.T) {
assert
.
True
(
t
,
c
.
HasErrors
())
c
.
ResetErrors
()
assert
.
False
(
t
,
c
.
HasErrors
())
assert
.
Empty
(
t
,
c
.
Errors
())
}
func
TestNewFlagDoesNotExistError
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
release.json
View file @
cf5f326e
{
"version"
:
"1.
2
.0"
}
{
"version"
:
"1.
3
.0"
}
This diff is collapsed.
Click to expand it.