github.com/konsorten/ktn-build-info@v1.0.11/ver/item_documentation.go (about)

     1  package ver
     2  
     3  import (
     4  	"sort"
     5  )
     6  
     7  type ItemDocumentationEntry struct {
     8  	Name        string
     9  	Description string
    10  }
    11  
    12  type ItemDocumentation []ItemDocumentationEntry
    13  
    14  func (s ItemDocumentation) Len() int {
    15  	return len(s)
    16  }
    17  
    18  func (s ItemDocumentation) Less(i, j int) bool {
    19  	a := &s[i]
    20  	b := &s[j]
    21  
    22  	return a.Name < b.Name
    23  }
    24  
    25  func (s ItemDocumentation) Swap(i, j int) {
    26  	s[i], s[j] = s[j], s[i]
    27  }
    28  
    29  func (s ItemDocumentation) Sort() {
    30  	sort.Sort(s)
    31  }