@@ -6,7 +6,7 @@ import "fmt"
6
6
type CompilerOption func (* compiler )
7
7
8
8
// WithModuleLoader is a compiler option for module loader.
9
- // If you want to load modules from the filesystem, use NewModuleLoader.
9
+ // If you want to load modules from the filesystem, use [ NewModuleLoader] .
10
10
func WithModuleLoader (moduleLoader ModuleLoader ) CompilerOption {
11
11
return func (c * compiler ) {
12
12
c .moduleLoader = moduleLoader
@@ -15,15 +15,15 @@ func WithModuleLoader(moduleLoader ModuleLoader) CompilerOption {
15
15
16
16
// WithEnvironLoader is a compiler option for environment variables loader.
17
17
// The OS environment variables are not accessible by default due to security
18
- // reason . You can pass os.Environ if you allow to access it .
18
+ // reasons . You can specify [ os.Environ] as argument if you allow to access.
19
19
func WithEnvironLoader (environLoader func () []string ) CompilerOption {
20
20
return func (c * compiler ) {
21
21
c .environLoader = environLoader
22
22
}
23
23
}
24
24
25
25
// WithVariables is a compiler option for variable names. The variables can be
26
- // used in the query. You have to give the values to code .Run in the same order.
26
+ // used in the query. You have to give the values to [*Code .Run] in the same order.
27
27
func WithVariables (variables []string ) CompilerOption {
28
28
return func (c * compiler ) {
29
29
c .variables = variables
@@ -35,20 +35,20 @@ func WithVariables(variables []string) CompilerOption {
35
35
// values should satisfy 0 <= minarity <= maxarity <= 30, otherwise panics.
36
36
// On handling numbers, you should take account to int, float64 and *big.Int.
37
37
// These are the number types you are allowed to return, so do not return int64.
38
- // Refer to ValueError to return a value error just like built-in error function.
39
- // If you want to emit multiple values, call the empty function, accept a filter
40
- // for its argument, or call another built-in function, then use LoadInitModules
41
- // of the module loader.
38
+ // Refer to [ ValueError] to return a value error just like built-in error
39
+ // function. If you want to emit multiple values, call the empty function,
40
+ // accept a filter for its argument, or call another built-in function, then
41
+ // use LoadInitModules of the module loader.
42
42
func WithFunction (name string , minarity , maxarity int ,
43
43
f func (interface {}, []interface {}) interface {}) CompilerOption {
44
44
return withFunction (name , minarity , maxarity , false , f )
45
45
}
46
46
47
47
// WithIterFunction is a compiler option for adding a custom iterator function.
48
- // This is like the WithFunction option, but you can add a function which
48
+ // This is like the [ WithFunction] option, but you can add a function which
49
49
// returns an Iter to emit multiple values. You cannot define both iterator and
50
50
// non-iterator functions of the same name (with possibly different arities).
51
- // See also NewIter, which can be used to convert values or an error to an Iter.
51
+ // See also [ NewIter] , which can be used to convert values or an error to an Iter.
52
52
func WithIterFunction (name string , minarity , maxarity int ,
53
53
f func (interface {}, []interface {}) Iter ) CompilerOption {
54
54
return withFunction (name , minarity , maxarity , true ,
@@ -91,7 +91,7 @@ func withFunction(name string, minarity, maxarity int, iter bool,
91
91
// Note that input and inputs functions are not allowed by default. We have
92
92
// to distinguish the query input and the values for input(s) functions. For
93
93
// example, consider using inputs with --null-input. If you want to allow
94
- // input(s) functions, create an Iter and use WithInputIter option.
94
+ // input(s) functions, create an [ Iter] and use WithInputIter option.
95
95
func WithInputIter (inputIter Iter ) CompilerOption {
96
96
return func (c * compiler ) {
97
97
c .inputIter = inputIter
0 commit comments