Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dgottlieb committed Jan 28, 2025
1 parent 5c3446a commit bfda26d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ type peerResourceState struct {

// Module represents an external resource module that services components/services.
type Module struct {
// The name of the module as per the robot config.
// The name of the module as per the robot config. This value is communicated via the
// `VIAM_MODULE_NAME` env var.
name string

shutdownCtx context.Context
Expand Down
6 changes: 2 additions & 4 deletions module/testmodule/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ func newHelper(
ctx context.Context, deps resource.Dependencies, conf resource.Config, logger logging.Logger,
) (resource.Resource, error) {
var dependsOnSensor sensor.Sensor
for _, resObj := range deps {
if resSensor, ok := resObj.(sensor.Sensor); ok {
dependsOnSensor = resSensor
}
if len(conf.DependsOn) > 0 {
dependsOnSensor, err := sensor.FromDependencies(deps, conf.DependsOn[0])
}

if len(deps) > 0 && dependsOnSensor == nil {
Expand Down
2 changes: 1 addition & 1 deletion robot/client/client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func newFuncRobotClientOption(f func(*robotClientOpts)) *funcRobotClientOption {
}

// WithModName attaches a unary interceptor that attaches the module name for each outgoing gRPC
// request.
// request. Should only be used in Viam module library code.
func WithModName(modName string) RobotClientOption {
return newFuncRobotClientOption(func(o *robotClientOpts) {
o.modName = modName
Expand Down

0 comments on commit bfda26d

Please sign in to comment.