(i *v1pb.Instance)
| 654 | } |
| 655 | |
| 656 | func redactInstance(i *v1pb.Instance) *v1pb.Instance { |
| 657 | if i == nil { |
| 658 | return nil |
| 659 | } |
| 660 | // Clone the instance to avoid modifying the original response |
| 661 | cloned := proto.CloneOf(i) |
| 662 | var dataSources []*v1pb.DataSource |
| 663 | for _, d := range cloned.DataSources { |
| 664 | dataSources = append(dataSources, redactDataSource(d)) |
| 665 | } |
| 666 | cloned.DataSources = dataSources |
| 667 | return cloned |
| 668 | } |
| 669 | |
| 670 | func redactDataSource(d *v1pb.DataSource) *v1pb.DataSource { |
| 671 | // Clone the datasource to avoid modifying the original |
no test coverage detected