File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- package core
15
+ package dep
16
16
17
- // @@ There is a scenario where we want users to rely on our package (alibaba/pkg/core ),
17
+ // @@ We want users to rely on our package (alibaba-otel /pkg/dep ),
18
18
// and after executing go mod vendor, all related dependencies are fetched
19
19
// locally. The subsequent build process can then be performed offline,
20
20
// without relying on go mod tidy/vendor to fetch any additional dependencies.
Original file line number Diff line number Diff line change @@ -710,10 +710,13 @@ func (dp *DepProcessor) preclean() {
710
710
util .Log ("Remove obsolete import %v from %v" ,
711
711
ruleImport , file )
712
712
}
713
- }
714
- _ , err := util .WriteAstToFile (astRoot , file )
715
- if err != nil {
716
- util .Log ("Failed to write ast to %v: %v" , file , err )
713
+ // Remove the import from the file, but before that, we need to
714
+ // backup the file
715
+ dp .backupFile (file )
716
+ _ , err := util .WriteAstToFile (astRoot , file )
717
+ if err != nil {
718
+ util .Log ("Failed to write ast to %v: %v" , file , err )
719
+ }
717
720
}
718
721
}
719
722
// Clean otel_pkgdep directory
You can’t perform that action at this time.
0 commit comments