Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove trailing whitespace #4670

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cli/module_generate/_templates/go/models/tmpl-module.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ type Config struct {
/*
Put config attributes here. There should be public/exported fields
with a `json` parameter at the end of each attribute.

Example config struct:
type Config struct {
Pin string `json:"pin"`
Board string `json:"board"`
MinDeg *float64 `json:"min_angle_deg,omitempty"`
}

If your model does not need a config, replace *Config in the init
If your model does not need a config, replace *Config in the init
function with resource.NoNativeConfig
*/

Expand All @@ -38,7 +38,7 @@ type Config struct {
// resource.TriviallyValidateConfig
}

// Validate ensures all parts of the config are valid and important fields exist.
// Validate ensures all parts of the config are valid and important fields exist.
// Returns implicit dependencies based on the config.
// The path is the JSON path in your robot's config (not the `Config` struct) to the
// resource being validated; e.g. "components.0".
Expand Down
2 changes: 1 addition & 1 deletion cli/module_generate/_templates/go/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export PATH=$PATH:$(go env GOPATH)/bin


echo "Downloading necessary go packages..."
if ! (
if ! (
go get go.viam.com/rdk@latest > /dev/null 2>&1
go get golang.org/x/tools/cmd/goimports@latest > /dev/null 2>&1
gofmt -w -s .
Expand Down
6 changes: 3 additions & 3 deletions cli/module_generate/_templates/go/tmpl-Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BIN_OUTPUT_PATH = bin
TOOL_BIN = bin/gotools/$(shell uname -s)-$(shell uname -m)
UNAME_S ?= $(shell uname -s)
GOPATH = $(HOME)/go/bin
export PATH := ${PATH}:$(GOPATH)
export PATH := ${PATH}:$(GOPATH)

build: format update-rdk
rm -f $(BIN_OUTPUT_PATH)/{{ .ModuleName}}
Expand All @@ -12,7 +12,7 @@ module.tar.gz: build
rm -f $(BIN_OUTPUT_PATH)/module.tar.gz
tar czf $(BIN_OUTPUT_PATH)/module.tar.gz $(BIN_OUTPUT_PATH)/{{ .ModuleName}}

setup:
setup:
if [ "$(UNAME_S)" = "Linux" ]; then \
sudo apt-get install -y apt-utils coreutils tar libnlopt-dev libjpeg-dev pkg-config; \
fi
Expand All @@ -26,7 +26,7 @@ clean:

format:
gofmt -w -s .

update-rdk:
go get go.viam.com/rdk@latest
go mod tidy
2 changes: 1 addition & 1 deletion cli/module_generate/_templates/go/tmpl-go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module {{.ModuleName}}

go 1.23
go 1.23
2 changes: 1 addition & 1 deletion cli/module_generate/_templates/go/tmpl-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func mainWithArgs(ctx context.Context, args []string, logger logging.Logger) err
if err != nil {
return err
}

if err = {{.ModuleCamel}}.AddModelFromRegistry(ctx, {{.ResourceSubtype}}.API, models.{{.ModelPascal}}); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cli/module_generate/scripts/generate_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def replace_async_func(
ast.Raise(
exc=ast.Call(func=ast.Name(id='NotImplementedError',
ctx=ast.Load()),
args=[],
args=[],
keywords=[]),
cause=None)
]
Expand Down
6 changes: 3 additions & 3 deletions cli/module_generate/scripts/tmpl-module
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ type Config struct {
/*
Put config attributes here. There should be public/exported fields
with a `json` parameter at the end of each attribute.

Example config struct:
type Config struct {
Pin string `json:"pin"`
Board string `json:"board"`
MinDeg *float64 `json:"min_angle_deg,omitempty"`
}

If your model does not need a config, replace *Config in the init
If your model does not need a config, replace *Config in the init
function with resource.NoNativeConfig
*/

Expand All @@ -39,7 +39,7 @@ type Config struct {
// resource.TriviallyValidateConfig
}

// Validate ensures all parts of the config are valid and important fields exist.
// Validate ensures all parts of the config are valid and important fields exist.
// Returns implicit dependencies based on the config.
// The path is the JSON path in your robot's config (not the `Config` struct) to the
// resource being validated; e.g. "components.0".
Expand Down
Loading