Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xflags
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
xflags
Commits
49803b6d
Commit
49803b6d
authored
1 year ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
53490626
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+3
-3
3 additions, 3 deletions
README.md
with
3 additions
and
3 deletions
README.md
+
3
−
3
View file @
49803b6d
...
...
@@ -72,7 +72,7 @@ The following tags are supported:
The functions are called up with a receiver. The receiver is the
configuration. The function must have the following signature:
`func (d *Definition) <name> (s *
s
etting[Definition])`
`func (d *Definition) <name> (s *
xflags.S
etting
s
[Definition])`
Let's assume we have the above definition. The Property
`Serve`
contains
the command
`serve`
. Furthermore, the command has the tag
`call`
with
...
...
@@ -87,13 +87,13 @@ The function is called with the receiver `*Definition`
An example for the function
`DoServe`
:
```
go
func
(
d
*
Definition
)
DoServe
(
_
*
s
etting
[
Definition
])
{
func
(
d
*
Definition
)
DoServe
(
_
*
xflags
.
S
etting
s
[
Definition
])
{
fmt
.
Printf
(
"Serving on %s:%d"
,
d
.
Serve
.
Host
,
d
.
Serve
.
Port
)
}
```
In this example, the function is called with the receiver
`*Definition`
.
The function is called with the setting
`*
s
etting[Definition]`
. The
The function is called with the setting
`*
xflags.S
etting
s
[Definition]`
. The
setting is used to get the values of the flags. But in this example, we
don't need the setting. So we use the underscore
`_`
to ignore the
setting.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment