Try to define a function that encapsulates the logic and returns result:
v, err := i.Eval(` import "strings" func trim(s string) string { return strings.TrimSpace(s) } trim(" foo ") `)