[WIP]fix #993

Add a test case and fix #993
This NPE happened because GoPackages.getTargetPackageIfDifferent do not handle builtin package not exist case.
This PR is conflict with #1001 , please first merge one of them, then I will rebase another one.