fixed spelling errors

This commit is contained in:
Annika Hannig 2022-11-10 12:15:52 +01:00
parent 5bb0d0aaf2
commit 9064364325
11 changed files with 15 additions and 18 deletions

View File

@ -31,7 +31,7 @@ type Neighbor struct {
}
// String encodes a neighbor as json. This is
// more readable than the golang default represenation.
// more readable than the golang default representation.
func (n *Neighbor) String() string {
repr, _ := json.Marshal(n)
return string(repr)

View File

@ -102,7 +102,7 @@ type RoutesResponse struct {
NotExported Routes `json:"not_exported"`
}
// CacheTTL returns the cache ttl of the reponse
// CacheTTL returns the cache ttl of the response
func (res *RoutesResponse) CacheTTL() time.Duration {
now := time.Now().UTC()
return res.Response.Meta.TTL.Sub(now)
@ -113,7 +113,7 @@ type TimedResponse struct {
RequestDuration float64 `json:"request_duration_ms"`
}
// Pagination strucutres information about the
// Pagination information, including the
// current page, total pages, page size, etc...
type Pagination struct {
Page int `json:"page"`

View File

@ -177,7 +177,7 @@ func (g *SearchFilterGroup) rebuildIndex() {
g.filtersIdx = idx // replace index
}
// A SearchFilterComparator comapres route with a filter
// A SearchFilterComparator compares route with a filter
type SearchFilterComparator func(route Filterable, value interface{}) bool
func searchFilterMatchSource(route Filterable, value interface{}) bool {
@ -351,7 +351,7 @@ func (s *SearchFilters) GetGroupByKey(key string) *SearchFilterGroup {
// and its counters.
//
// Update filter struct to include route:
// - Extract ASN, source, bgp communites,
// - Extract ASN, source, bgp communities,
// - Find Filter in group, increment result count if required.
func (s *SearchFilters) UpdateFromLookupRoute(r *LookupRoute) {
// Add source

View File

@ -36,7 +36,7 @@ func StringList(data interface{}) []string {
}
// TrimmedCSVStringList makes a trimmed list of CSV strings
// ommitting empty values.
// omitting empty values.
func TrimmedCSVStringList(s string) []string {
tokens := strings.Split(s, ",")
list := []string{}

View File

@ -39,7 +39,7 @@ type apiEndpoint func(
httprouter.Params,
) (response, error)
// Wrap handler for access controll, throtteling and compression
// Wrap handler for access control, throtteling and compression
func endpoint(wrapped apiEndpoint) httprouter.Handle {
return func(res http.ResponseWriter,
req *http.Request,

View File

@ -38,7 +38,7 @@ func NewErrAmbigousParam(key string) *ErrValidationFailed {
}
// NewErrEmptyParam return an ErrValidationFailed if the
// provided paramter value is empty.
// provided parameter value is empty.
func NewErrEmptyParam(key string) *ErrValidationFailed {
return &ErrValidationFailed{
Param: key,

View File

@ -8,7 +8,7 @@ import (
)
func TestApiLogSourceError(t *testing.T) {
err := fmt.Errorf("an unexpected error occured")
err := fmt.Errorf("an unexpected error occurred")
cfg := &config.Config{
Sources: []*config.SourceConfig{

View File

@ -153,9 +153,6 @@ func (b *GenericBirdwatcher) filterRoutesByDuplicates(
// Remove routes from "routes" that are contained within filterRoutes
for _, filterRoute := range filterRoutes {
delete(routesMap, filterRoute.ID)
// in theorey this guard is unneccessary
//if _, ok := routesMap[filterRoute.ID]; ok {
// }
}
for _, route := range routesMap {

View File

@ -160,9 +160,9 @@ func TestLookupPrefixForNeighbors(t *testing.T) {
t.Fatal(err)
}
// We should have retrived 8 prefixes,
// We should have retrieved 8 prefixes,
if len(results) != 8 {
t.Error("Expected result lenght: 8, got:", len(results))
t.Error("Expected result length: 8, got:", len(results))
}
presence := []string{

View File

@ -141,7 +141,7 @@ func (s *SourcesStore) getStatus(sourceID string) (*Status, error) {
}
// IsInitialized will retrieve the status of the source
// and check if a successful refresh happend at least
// and check if a successful refresh happened at least
// once.
func (s *SourcesStore) IsInitialized(sourceID string) (bool, error) {
s.Lock()
@ -190,7 +190,7 @@ func (s *SourcesStore) ShouldRefresh(
}
if status.State == StateError {
// The refresh interval in the config is ok if the
// success case. When an error occures it is desireable
// success case. When an error occures it is desirable
// to retry sooner, without spamming the server.
nextRefresh = status.LastRefresh.Add(10 * time.Second)
}
@ -303,7 +303,7 @@ func (s *SourcesStore) LockSource(sourceID string) error {
return nil
}
// RefreshSuccess indicates a successfull update
// RefreshSuccess indicates a successful update
// of the store's content.
func (s *SourcesStore) RefreshSuccess(sourceID string) error {
s.Lock()

View File

@ -6,7 +6,7 @@ import (
func TestContainsCi(t *testing.T) {
if ContainsCi("foo bar", "BaR") != true {
t.Error("An unexpected error occured.")
t.Error("An unexpected error occurred.")
}
if ContainsCi("Luxembourg Online SA", "Goo") == true {
t.Error("Should ne no match")