build: rework dependencies handling

Signed-off-by: Alejandro Mery <amery@geeks.cl>
Rearrange code for go.sancus.io/go-import

Signed-off-by: Alejandro Mery <amery@geeks.cl>