Skip to content

Commit

Permalink
#59 add golang hello-world.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanakaryo committed Apr 28, 2024
1 parent 002103f commit b280ecb
Show file tree
Hide file tree
Showing 4 changed files with 1,898 additions and 0 deletions.
21 changes: 21 additions & 0 deletions services/cloud-functions/golang/app1/helloworld/cmd/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package main

import (
"log"
"os"

// Blank-import the function package so the init() runs
_ "example.com/hello"
"github.com/GoogleCloudPlatform/functions-framework-go/funcframework"
)

func main() {
// Use PORT environment variable, or default to 8080.
port := "8080"
if envPort := os.Getenv("PORT"); envPort != "" {
port = envPort
}
if err := funcframework.Start(port); err != nil {
log.Fatalf("funcframework.Start: %v\n", err)
}
}
17 changes: 17 additions & 0 deletions services/cloud-functions/golang/app1/helloworld/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module example.com/hello

go 1.22.1

require github.com/GoogleCloudPlatform/functions-framework-go v1.8.1

require (
cloud.google.com/go/functions v1.15.3 // indirect
github.com/cloudevents/sdk-go/v2 v2.14.0 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
go.uber.org/atomic v1.4.0 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.10.0 // indirect
)
Loading

0 comments on commit b280ecb

Please sign in to comment.