code: func sortByHookWeight(hooks []*release.Hook) []*release.Hook {
  	hs := newHookWeightSorter(hooks)
  	sort.Sort(hs)
  	return hs.hooks
  }
docs: // sortByHookWeight does an in-place sort of hooks by their supplied weight.