internal/postgres: fix GetUnit tests
Trust: Julie Qiu
Run-TryBot: Julie Qiu
TryBot-Result: kokoro
@@ -196,8 +196,11 @@ func (db *DB) GetUnit(ctx context.Context, um *internal.UnitMeta, fields interna
if err != nil {
return nil, err
}
+ // Return nil if there are no symbols, instead of an empty map.
+ if len(u.Symbols) > 0 {
u.Symbols = symbols
}
+ }
if fields&internal.WithImports != 0 {
imports, err := db.getImports(ctx, unitID)
if err != nil {
