You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dag.go
    path of file: ./repos/bud/internal/dag2
    
    the code of the file until where you have to start completion: package dag2

import (
	"fmt"
	"sort"
	"strings"
	"sync"
)

func New() *Graph {
	return &Graph{
		nodes: map[string]struct{}{},
		ins:   map[string]map[string]struct{}{},
		outs:  map[string]map[string]struct{}{},
	}
}

type Graph struct {
	mu    sync.RWMutex
	nodes map[string]struct{}
	ins   map[string]map[string]struct{}
	outs  map[string]map[string]struct{}
}

func (g *Graph) Nodes() (nodes []string) {
	for path := range g.nodes {
		nodes = append(nodes, path)
	}
	sort.Strings(nodes)
	return nodes
}

func (g *Graph) Set(path string) {
	g.mu.Lock()
	defer g.mu.Unlock()
	g.nodes[path] 
    
func (g *Graph) shortestPath(start, end string, paths []string) (shortest []string, err error) {
	if _, ok := g.nodes[start]; !ok {
		return nil, fmt.Errorf("dag: %q doesn't exist", start)
	}
	paths = append(paths, start)
	if start == end {
		return paths, nil
	}
	for _, node := range g.children(start) {
		if hasNode(paths, node) {
			continue
		}
		newPath, err := g.shortestPath(node, end, paths)
		if err != nil {
			return nil, err
		}
		lenNewPath := len(newPath)
		lenShortest := len(shortest)
		if lenNewPath == 0 {
			continue
		}
		if lenShortest == 0 || lenNewPath < lenShortest {
			shortest = newPath
		}
	}
	if len(shortest) == 0 {
		return nil, fmt.Errorf("dag: no path between %q and %q", start, end)
	}
	return shortest, nil
}