blob: 171046fa60f94b54e1be1794399d98b08ca3366b [file] [log] [blame]
Joey Armstrong1eb713f2024-01-30 13:53:00 -05001.. _Release Task Golang Mod Update:
2
3GOLANG: Update go.mod opencord package versions
4===============================================
5
6Update go package version dependencies.
7
8NOTE: 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