Attack a Specific Entity

You can pass an entity table:

local e = nearestEntity_get("minecraft:zombie")
gol.attackAt(e)

Attack by Entity Type

gol.attackAt("minecraft:zombie")

Targets the nearest entity of that type.