Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
bddd092d
Commit
bddd092d
authored
May 19, 2011
by
David Symonds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flag: fix docs on flag.Var.
R=golang-dev, r CC=golang-dev
https://golang.org/cl/4539067
parent
24b2f48a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
flag.go
src/pkg/flag/flag.go
+6
-2
No files found.
src/pkg/flag/flag.go
View file @
bddd092d
...
@@ -405,8 +405,12 @@ func Float64(name string, value float64, usage string) *float64 {
...
@@ -405,8 +405,12 @@ func Float64(name string, value float64, usage string) *float64 {
return
p
return
p
}
}
// Var defines a user-typed flag with specified name, default value, and usage string.
// Var defines a flag with the specified name and usage string. The type and
// The argument p points to a Value variable in which to store the value of the flag.
// value of the flag are represented by the first argument, of type Value, which
// typically holds a user-defined implementation of Value. For instance, the
// caller could create a flag that turns a comma-separated string into a slice
// of strings by giving the slice the methods of Value; in particular, Set would
// decompose the comma-separated string into the slice.
func
Var
(
value
Value
,
name
string
,
usage
string
)
{
func
Var
(
value
Value
,
name
string
,
usage
string
)
{
// Remember the default value as a string; it won't change.
// Remember the default value as a string; it won't change.
f
:=
&
Flag
{
name
,
usage
,
value
,
value
.
String
()}
f
:=
&
Flag
{
name
,
usage
,
value
,
value
.
String
()}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment