Conditional imports?

If your concern is only errors from unused imports, you can declare them to _ to avoid that.

import "core:fmt"
_ :: fmt
// no error with -vet-unused-imports if fmt is never used

Otherwise, you can’t make the import itself conditional aside from build tags/file suffixes, which aren’t flexible for anything more than per-platform code selection. Generally, if you don’t use the contents of the package, it won’t end up in the final binary, so the import itself doesn’t actually need to be conditional.