func Duplicates(pkgs []string) []string {
	result := []string{}
	seen := map[string]string{}
	for _, val := range pkgs {
		if _, ok := seen[val]; !ok {
			result = append(result, val)
			seen[val] = val
		}
	}
	return result
}
Duplicates filters out any duplicate packages.
package filters
import (
	"errors"
	"log"
	"os"
	"path"
	"path/filepath"
	"strings"
)
func Standard(pkgs []string) []string {
	var list []string
	for _, pkg := range pkgs {
		if pkg == "C" || pkg[0] == '.' {
			continue
		}
		name := path.Base(pkg)
		if stds, ok := stdpkgs[name]; ok {
			for _, stdpkg := range stds {
				if pkg == stdpkg.path {
					goto SKIP
				}
			}
		}
		list = append(list, pkg)
	SKIP:
	}
	return list
}
func Exceptions(pkgs []string) []string {
	var list []string
	for _, pkg := range pkgs {
		for _, exception := range ExceptionList {
			if Match(pkg, exception) {
				goto SKIP
			}
		}
		list = append(list, pkg)
	SKIP:
	}
	return list
}