Skip to content

Commit

Permalink
all: add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Feb 22, 2024
1 parent a4fc949 commit 5a9211e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions internal/aghtest/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ var _ filtering.Resolver = (*aghtest.Resolver)(nil)
var _ dnsforward.ClientsContainer = (*aghtest.ClientsContainer)(nil)

// type check
//
// TODO(s.chzhen): It's here to avoid the import cycle. Remove it.
var _ client.AddressProcessor = (*aghtest.AddressProcessor)(nil)

// type check
//
// TODO(s.chzhen): It's here to avoid the import cycle. Remove it.
var _ client.AddressUpdater = (*aghtest.AddressUpdater)(nil)
4 changes: 2 additions & 2 deletions internal/client/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ func (ci *Index) findByMAC(mac net.HardwareAddr) (c *Persistent, found bool) {
return nil, false
}

// Del removes information about persistent client from the index. c must be
// Delete removes information about persistent client from the index. c must be
// non-nil.
func (ci *Index) Del(c *Persistent) {
func (ci *Index) Delete(c *Persistent) {
for _, id := range c.ClientIDs {
delete(ci.clientIDToUID, id)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/client/index_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func TestClientIndex_Clashes(t *testing.T) {
err := ci.Clashes(clone)
require.Error(t, err)

ci.Del(tc.client)
ci.Delete(tc.client)
err = ci.Clashes(clone)
require.NoError(t, err)
})
Expand Down
3 changes: 2 additions & 1 deletion internal/client/persistent.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ func (c *Persistent) setID(id string) (err error) {

// ValidateClientID returns an error if id is not a valid ClientID.
//
// Keep in sync with [dnsforward.ValidateClientID].
// TODO(s.chzhen): It's an exact copy of the [dnsforward.ValidateClientID] to
// avoid the import cycle. Remove it.
func ValidateClientID(id string) (err error) {
err = netutil.ValidateHostnameLabel(id)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/home/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ func (clients *clientsContainer) removeLocked(c *client.Persistent) {
delete(clients.list, c.Name)

// Update the ID index.
clients.clientIndex.Del(c)
clients.clientIndex.Delete(c)
}

// update updates a client by its name.
Expand Down

0 comments on commit 5a9211e

Please sign in to comment.