Skip to content

Commit

Permalink
fix: explicitly define function's output to boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
ieth0 committed Dec 14, 2023
1 parent f902041 commit 358be14
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Sample output in `/etc/bird/birdwatcher.conf` if `haproxy_check.sh` checks out w

```
# DO NOT EDIT MANUALLY
function match_route()
function match_route() -> bool
{
return net ~ [
192.168.0.0/24,
Expand All @@ -45,7 +45,7 @@ As soon as birdwatcher finds out haproxy is down, it will change the content in

```
# DO NOT EDIT MANUALLY
function match_route()
function match_route() -> bool
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion birdwatcher/templates/function.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function {{.FunctionName}}()
function {{.FunctionName}}() -> bool
{
{{- with .Prefixes}}
return net ~ [
Expand Down
2 changes: 1 addition & 1 deletion birdwatcher/testdata/bird/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DO NOT EDIT MANUALLY
function match_route()
function match_route() -> bool
{
return net ~ [
1.2.3.4/32,
Expand Down
2 changes: 1 addition & 1 deletion birdwatcher/testdata/bird/config_empty
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DO NOT EDIT MANUALLY
function match_route()
function match_route() -> bool
{
return false;
}
2 changes: 1 addition & 1 deletion birdwatcher/testdata/prefixset/function_name
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function something_else()
function something_else() -> bool
{
return net ~ [
1.2.3.4/32,
Expand Down
2 changes: 1 addition & 1 deletion birdwatcher/testdata/prefixset/some_prefixes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function foobar()
function foobar() -> bool
{
return net ~ [
1.2.3.4/32,
Expand Down

0 comments on commit 358be14

Please sign in to comment.