Funções abaixo serão implementadas em nova Feature planejada. :D Função auxiliar para obter diferenças específicas de um arquivo
(filepath string)
| 101 | |
| 102 | // Função auxiliar para obter diferenças específicas de um arquivo |
| 103 | func GetFileDiff(filepath string) (string, error) { |
| 104 | cmd := exec.Command("git", "diff", filepath) //#nosec G204 -- agent/CLI tool execution; commands validated by command_validator + policy_manager upstream |
| 105 | output, err := cmd.Output() |
| 106 | if err != nil { |
| 107 | return "", fmt.Errorf("erro ao obter diferenças do arquivo %s: %w", filepath, err) |
| 108 | } |
| 109 | return string(output), nil |
| 110 | } |
| 111 | |
| 112 | // Função auxiliar para obter o histórico de um arquivo específico |
| 113 | func GetFileHistory(filepath string) (string, error) { |