ci: check format in CI pipeline (#17)
Reviewed-on: #17 Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #17.
This commit is contained in:
@@ -40,3 +40,5 @@ jobs:
|
|||||||
run: make build
|
run: make build
|
||||||
- name: test
|
- name: test
|
||||||
run: make test
|
run: make test
|
||||||
|
- name: check:format
|
||||||
|
run: make check-format
|
||||||
|
|||||||
15
Makefile
15
Makefile
@@ -6,3 +6,18 @@ build:
|
|||||||
|
|
||||||
lint:
|
lint:
|
||||||
golint ./...
|
golint ./...
|
||||||
|
|
||||||
|
run:
|
||||||
|
make build
|
||||||
|
./realdyndns
|
||||||
|
|
||||||
|
format:
|
||||||
|
gofmt -w .
|
||||||
|
|
||||||
|
check-format:
|
||||||
|
@OUTPUT=$$(gofmt -l .); \
|
||||||
|
if [ -n "$$OUTPUT" ]; then \
|
||||||
|
echo "Formatter failed for:"; \
|
||||||
|
echo "$$OUTPUT"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ func (c *Config) Load(filePath string) error {
|
|||||||
return fmt.Errorf("failed to validate config: %w", err)
|
return fmt.Errorf("failed to validate config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil;
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config) validate() error {
|
func (c *Config) validate() error {
|
||||||
@@ -68,5 +68,5 @@ func (c *Config) validate() error {
|
|||||||
return errors.New("check interval must be set when mode is 'Scheduled'")
|
return errors.New("check interval must be set when mode is 'Scheduled'")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil;
|
return nil
|
||||||
}
|
}
|
||||||
@@ -171,8 +171,6 @@ func (i *IonosAPIImpl) SetARecord(tld string, subdomain string, ip net.IP, ttl i
|
|||||||
return nil, errors.New("error updating record")
|
return nil, errors.New("error updating record")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
changeRecord := ChangeRecord{}
|
changeRecord := ChangeRecord{}
|
||||||
json.Unmarshal(responseBody, &changeRecord)
|
json.Unmarshal(responseBody, &changeRecord)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user