Skip to content

Commit 4d5bbcd

Browse files
Merge pull request #1043 from newrelic/pchinthapenta-go-deploy-config-update
chore:update go deploy config with go mod and go sum
2 parents e46206a + f9708e8 commit 4d5bbcd

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

test/deploy/linux/go/redhat/roles/configure/tasks/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
- "../../../../templates/*"
2121
become: true
2222

23+
- name: Run go mod init
24+
shell: cd /home/ec2-user/templates && go mod init home/ec2-user/templates
25+
become: true
26+
27+
- name: Run go mod tidy
28+
shell: cd /home/ec2-user/templates && go mod tidy
29+
become: true
30+
31+
- name: Change Permissions for /home/ec2-user/templates
32+
shell: chown -R ec2-user:ec2-user /home/ec2-user/templates/ && chmod -R 755 /home/ec2-user/templates
33+
become: true
34+
2335
# Use the below command to run it locally
2436
# - name: Run sample go application
2537
# ansible.builtin.shell: cd ~/templates && go build . && nohup ./gosampleapp &

test/deploy/linux/go/templates/server.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ func main() {
1414
go client()
1515

1616
//codeSnippet
17+
18+
1719
transactions := make(chan string)
1820

1921
go func() {
@@ -26,6 +28,9 @@ func main() {
2628
}()
2729

2830
//routerSnippet
31+
32+
33+
2934
router.GET("/transaction", func(c *gin.Context) {
3035
transaction := <-transactions
3136
c.JSON(200, gin.H{

0 commit comments

Comments
 (0)