Skip to main content
endswith(str, suffix) returns true if str ends with suffix, and false otherwise.

Signature

Example

Skip the linter when the playbook is loaded outside of a Go project:
Or use it to validate a file path variable before running a task:

Notes

  • The comparison is case-sensitive. Use lower on both arguments for a case-insensitive check.
  • Returns false when suffix is longer than str.