Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
abe-winter committed Dec 4, 2024
1 parent 6350e82 commit 9bacf03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ func (m *Manager) getCachedConfig() (map[string]*pb.DeviceSubsystemConfig, error
cachedConfig := map[string]*pb.DeviceSubsystemConfig{SubsystemName: {}}

cacheFilePath := filepath.Join(ViamDirs["cache"], agentCachePath)
//nolint:gosec
cacheBytes, err := os.ReadFile(cacheFilePath)

cacheBytes, err := os.ReadFile(cacheFilePath) //nolint:gosec
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
return cachedConfig, nil
Expand Down Expand Up @@ -423,10 +423,10 @@ func (m *Manager) dial(ctx context.Context) error {
return nil
}

// process non-subsystem effects of a config (i.e. agent-specific stuff that needs to happen when loading cache).
// process non-subsystem effects of a config (i.e. agent-specific stuff that needs to happen when loading cache and when updating).
func (m *Manager) processConfig(cfg map[string]*pb.DeviceSubsystemConfig) {
if agent, ok := cfg["viam-agent"]; ok {
if debug, ok := agent.Attributes.AsMap()["debug"].(bool); !ok {
if debug, ok := agent.GetAttributes().AsMap()["debug"].(bool); !ok {
m.logger.Error("viam-agent debug attribute is present but is not a bool")
} else {
// note: if this is present (true or false, rather than missing) it overrides the CLI debug switch.
Expand Down

0 comments on commit 9bacf03

Please sign in to comment.