Connection from GOlang RESTAPI to mongodb failing in VSCODE

Somehow , independently mongdb runs in vscode, after adding PATH variable in system’s variable.
But, I am stuck with the error at package main, basically how to build a go mod file? What are the steps to build a go mod file? This is a concern, when I am trying to use RESTAPI like gorilla mux.
I have stopped using Mongo driver gopkg.in/mgo.v2. And tried using mongo driver from official document but still not able to insert data to mongodb via REST API in golang. Below is the link where you can see the code and the screenshot.
Do you mind coming for a meeting for 5 mins may be. I can share my screen and show you what is happening. My email ID is : 2019hc04737@wilp.bits-pilani.ac.in, I can send a meeting invite, if you agree.