MCPcopy Create free account
hub / github.com/decomp/decomp / addDelImportFn

Function addDelImportFn

cmd/go-post/import_test.go:432–445  ·  view source on GitHub ↗
(p1 string, p2 string)

Source from the content-addressed store, hash-verified

430}
431
432func addDelImportFn(p1 string, p2 string) func(*ast.File) bool {
433 return func(f *ast.File) bool {
434 fixed := false
435 if !imports(f, p1) {
436 addImport(f, p1)
437 fixed = true
438 }
439 if imports(f, p2) {
440 deleteImport(f, p2)
441 fixed = true
442 }
443 return fixed
444 }
445}
446
447func rewriteImportFn(oldnew ...string) func(*ast.File) bool {
448 return func(f *ast.File) bool {

Callers 1

import_test.goFile · 0.85

Calls 3

importsFunction · 0.85
addImportFunction · 0.85
deleteImportFunction · 0.85

Tested by

no test coverage detected