(input []string, seed int64)
| 106 | } |
| 107 | |
| 108 | func makeShortcuts(input []string, seed int64) (shortcuts, []string) { |
| 109 | rand := rand.New(rand.NewSource(seed)) |
| 110 | |
| 111 | s := shortcuts{} |
| 112 | var output, chunk []string |
| 113 | for _, l := range input { |
| 114 | chunk = append(chunk, l) |
| 115 | switch rand.Intn(3) { |
| 116 | case 0: |
| 117 | // Create a macro for commands in 'chunk'. |
| 118 | macro := fmt.Sprintf("alias%d", len(s)) |
| 119 | s[macro] = chunk |
| 120 | output = append(output, macro) |
| 121 | chunk = nil |
| 122 | case 1: |
| 123 | // Append commands in 'chunk' by themselves. |
| 124 | output = append(output, chunk...) |
| 125 | chunk = nil |
| 126 | case 2: |
| 127 | // Accumulate commands into 'chunk' |
| 128 | } |
| 129 | } |
| 130 | output = append(output, chunk...) |
| 131 | return s, output |
| 132 | } |
| 133 | |
| 134 | func checkValue(p *profile.Profile, cmd []string, cfg config, o *plugin.Options) error { |
| 135 | if len(cmd) != 2 { |
no outgoing calls
no test coverage detected
searching dependent graphs…