File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
functions/helloworld/groovy-hello-pubsub/src/main/groovy/functions Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import com.google.cloud.functions.BackgroundFunction
5
5
import com.google.cloud.functions.Context
6
6
import functions.eventpojos.PubSubMessage
7
7
import java.nio.charset.StandardCharsets
8
- import java.util.logging.Logger ;
8
+ import java.util.logging.Logger
9
9
10
10
class GroovyHelloPubSub implements BackgroundFunction<PubSubMessage > {
11
11
private static final Logger LOGGER = Logger . getLogger(GroovyHelloPubSub . class. name)
@@ -15,11 +15,11 @@ class GroovyHelloPubSub implements BackgroundFunction<PubSubMessage> {
15
15
// name's default value is "world"
16
16
String name = " world"
17
17
18
- if (message?. data != null ) {
19
- name = new String (Base64 . getDecoder() . decode(message. data), StandardCharsets . UTF_8 )
18
+ if (message?. data) {
19
+ name = new String (Base64 . decoder . decode(message. data), StandardCharsets . UTF_8 )
20
20
}
21
21
22
- LOGGER . info(String . format( " Hello %s! " , name) )
22
+ LOGGER . info(" Hello ${ name } ! " )
23
23
return
24
24
}
25
25
}
You can’t perform that action at this time.
0 commit comments