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: templates.go
    path of file: ./repos/bombardier
    
    the code of the file until where you have to start completion: package main

import "strings"

var (
	templates = map[string][]byte{
		"plain-text": []byte(plainTextTemplate),
		"json":       []byte(jsonTemplate),
	}
)

type format interface{}
type knownFormat string

func (kf knownFormat) template() []byte {
	return templates[string(kf)]
    
func formatFromString(formatSpec string) format {
	const prefix = "path:"
	if strings.HasPrefix(formatSpec, prefix) {
		return userDefinedTemplate(formatSpec[len(prefix):])
	}
	switch formatSpec {
	case "pt", "plain-text":
		return knownFormat("plain-text")
	case "j", "json":
		return knownFormat("json")
	}
	// nil represents unknown format
	return nil
}