(path, version string)
| 134 | } |
| 135 | |
| 136 | func gitShow(path, version string) ([]byte, error) { |
| 137 | out, err := exec.Command("git", "show", version+":"+path).CombinedOutput() //nolint:gosec |
| 138 | if err != nil { |
| 139 | return nil, xerrors.Errorf("git show: %s\n", out) |
| 140 | } |
| 141 | return out, nil |
| 142 | } |
| 143 | |
| 144 | func stripGenPreamble(bs []byte) []byte { |
| 145 | return regexp.MustCompile(`(?im)^(-- Code generated.*DO NOT EDIT.)$`).ReplaceAll(bs, []byte{}) |