github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/text/internal/format/format.go (about)

     1  // Copyright 2015 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Package format contains types for defining language-specific formatting of
     6  // values.
     7  //
     8  // This package is internal now, but will eventually be exposed after the API
     9  // settles.
    10  package format // import "golang.org/x/text/internal/format"
    11  
    12  import (
    13  	"fmt"
    14  
    15  	"golang.org/x/text/language"
    16  )
    17  
    18  // State represents the printer state passed to custom formatters. It provides
    19  // access to the fmt.State interface and the sentence and language-related
    20  // context.
    21  type State interface {
    22  	fmt.State
    23  
    24  	// Language reports the requested language in which to render a message.
    25  	Language() language.Tag
    26  
    27  	// TODO: more info:
    28  	// - sentence context
    29  	// - user preferences, like measurement systems
    30  	// - options
    31  }
    32  
    33  // A Statement is a Var or an Expression.
    34  type Statement interface {
    35  	statement()
    36  }
    37  
    38  // A String a literal string format.
    39  type String string
    40  
    41  func (String) statement() {}
    42  
    43  // TODO: Select, Var, Case, StatementSequence