NewParamSet creates a set of parameters with the given list of already used positions
(positionsUsed map[int]bool, hasNamedSupport bool)
| 65 | |
| 66 | // NewParamSet creates a set of parameters with the given list of already used positions |
| 67 | func NewParamSet(positionsUsed map[int]bool, hasNamedSupport bool) *ParamSet { |
| 68 | positionToName := make(map[int]string, len(positionsUsed)) |
| 69 | for index, used := range positionsUsed { |
| 70 | if !used { |
| 71 | continue |
| 72 | } |
| 73 | |
| 74 | // assume the previously used params have no name |
| 75 | positionToName[index] = "" |
| 76 | } |
| 77 | |
| 78 | return &ParamSet{ |
| 79 | argn: 1, |
| 80 | namedParams: make(map[string]Param), |
| 81 | namedLocs: make(map[string][]int), |
| 82 | hasNamedSupport: hasNamedSupport, |
| 83 | positionToName: positionToName, |
| 84 | } |
| 85 | } |
no outgoing calls