code: func Pattern(cfg *Config, word *syntax.Word) (string, error) {
  	cfg = prepareConfig(cfg)
  	field, err := cfg.wordField(word.Parts, quoteNone)
  	if err != nil {
  		return "", err
  	}
  	buf := cfg.strBuilder()
  	for _, part := range field {
  		if part.quote > quoteNone {
  			buf.WriteString(syntax.QuotePattern(part.val))
  		} else {
  			buf.WriteString(part.val)
  		}
  	}
  	return buf.String(), nil
  }
docs: // Pattern expands a single shell word as a pattern, using syntax.QuotePattern
  // on any non-quoted parts of the input word. The result can be used on
  // syntax.TranslatePattern directly.
  //
  // The config specifies shell expansion options; nil behaves the same as an
  // empty config.