Joey Armstrong | 1eb713f | 2024-01-30 13:53:00 -0500 | [diff] [blame] | 1 | .. _Release Task Golang Mod Update: |
| 2 | |
| 3 | GOLANG: Update go.mod opencord package versions |
| 4 | =============================================== |
| 5 | |
| 6 | Update go package version dependencies. |
| 7 | |
| 8 | NOTE: Files in the vendor/ directory should not be modified |
| 9 | |
| 10 | - Sources are checked in purely for bootstrapping. |
| 11 | - Ideally vendor/ will be deleted and populated dynamically by git submodules. |
| 12 | |
| 13 | .. code-block:: shell-session |
| 14 | :caption: Update copyrigth notice ending date. |
| 15 | |
| 16 | % git clone ssh://gerrit.opencord.org:29418/ofagent-go.git |
| 17 | % cd ofagent-go |
| 18 | |
| 19 | # --------------------------------------- |
| 20 | # Preview packages and versions to modify |
| 21 | # --------------------------------------- |
| 22 | % grep opencord $(find . ! -path 'vendor/*' -name '*.go' -print) |
| 23 | |
| 24 | # -------------------------------------------------------------- |
| 25 | # Edit go.mod and update dependencies as needed |
| 26 | # -------------------------------------------------------------- |
| 27 | % ${EDITOR} $(find . ! -path 'vendor/*' -name '*.go' -print) |
| 28 | |
| 29 | % make distclean |
| 30 | |
| 31 | # ------------------------------ |
| 32 | # Bulk fix golang linting errors |
| 33 | # ------------------------------ |
| 34 | % find . ! -path 'vendor/*' -name '*.go' -print0 | xargs -0 gofmt -s -e -w |
| 35 | |
| 36 | # --------------------------- |
| 37 | # Invoke go mod vendor |
| 38 | # Invoke go mod tidy |
| 39 | # From within a local sandbox |
| 40 | # --------------------------- |
| 41 | % make mod-update LOCAL_FIX_PERMS=1 |
| 42 | |
| 43 | # ------------------------- |
| 44 | # Check for syntax problems |
| 45 | # ------------------------- |
| 46 | % make lint |
| 47 | |
| 48 | # ----------------------------------- |
| 49 | # Pre-screen for jenkins job problems |
| 50 | # ----------------------------------- |
| 51 | % make build |
| 52 | % make test |