Skip to content

Commit bf9345c

Browse files
authored
fix: file has been changed unintentionally (#404)
1 parent 37bd004 commit bf9345c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Diff for: pkg/core/importer.go renamed to pkg/dep/importer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package core
15+
package dep
1616

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),
1818
// and after executing go mod vendor, all related dependencies are fetched
1919
// locally. The subsequent build process can then be performed offline,
2020
// without relying on go mod tidy/vendor to fetch any additional dependencies.

Diff for: tool/preprocess/preprocess.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,13 @@ func (dp *DepProcessor) preclean() {
710710
util.Log("Remove obsolete import %v from %v",
711711
ruleImport, file)
712712
}
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+
}
717720
}
718721
}
719722
// Clean otel_pkgdep directory

0 commit comments

Comments
 (0)