When I use "Step Into" in the debugger, it jumps into functions/types from outside my project (stdlib, vendor, etc.). How can I configure the debugger to step only into my own code? That's my code.
package main
import (
"encoding/json"
"fmt"
"os"
)
var cmdAdd string
var surname string
type Task struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
}
func main() {
fileTaskTracker := "tasks.json"
if len(os.Args) < 2 {
fmt.Println("Please provide a command add, update or delete")
return
}
tasks := []Task{}
// Marshal the struct to JSON
jsonData, err := json.MarshalIndent(tasks, "", " ") // Use MarshalIndent for pretty-printing
if err != nil {
fmt.Println("Error marshalling JSON:", err)
return
}
err = os.WriteFile(fileTaskTracker, jsonData, 0644) // 0644 sets file permissions
if err != nil {
fmt.Printf("Error writing to file: %v\n", err)
return
}
fmt.Println(jsonData)
}
I set break point on line:
jsonData, err := json.MarshalIndent(tasks, "", " ") // Use MarshalIndent for pretty-printing