Joey Armstrong | a144ef3 | 2024-01-11 11:26:41 -0500 | [diff] [blame] | 1 | .. _Release Task Golang Syntax: |
| 2 | |
| 3 | GOLANG: Syntax formatting with gofmt |
| 4 | ==================================== |
| 5 | |
| 6 | Use the gofmt command to reformat golang sources gathered outside the vendor/ directory. |
| 7 | |
| 8 | .. code-block:: shell-session |
Joey Armstrong | 1eb713f | 2024-01-30 13:53:00 -0500 | [diff] [blame] | 9 | :caption: Golang source formatting |
Joey Armstrong | a144ef3 | 2024-01-11 11:26:41 -0500 | [diff] [blame] | 10 | |
Joey Armstrong | 1eb713f | 2024-01-30 13:53:00 -0500 | [diff] [blame] | 11 | % git clone ssh://gerrit.opencord.org:29418/voltha-lib-go.git |
| 12 | % cd voltha-lib-go |
| 13 | |
| 14 | % make sterile |
Joey Armstrong | a144ef3 | 2024-01-11 11:26:41 -0500 | [diff] [blame] | 15 | % make golang-fmt |
| 16 | |
Joey Armstrong | a144ef3 | 2024-01-11 11:26:41 -0500 | [diff] [blame] | 17 | % find . ! -path './vendor/\*' -name '*.go' -print | xargs -n1 gofmt -s -e -w |