The errors you're encountering are caused by the type mismatch between `net.PacketConn` and `net.Conn`, as well as the use of the `WriteTo` method which isn't found on the `*ipv4.Conn` type.
Here's the amended code that fixes those issues:
1. Use `net.PacketConn` directly since `ipv4.NewConn` expects a `net.PacketConn`.
2. Use the `p.WriteTo` method correctly with the required parameters.
Here is the revised code:
```go
package main
import


