File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ import (
10
10
"github.com/hatobus/UKEMOCHI/model"
11
11
)
12
12
13
- var c = credentials .NewStaticCredentials (os .Getenv (("AWS_ACCESS_KEY" )), os .Getenv ("AWS_SECRET_ACCESS_KEY" ), "" ) // 最後の引数は[セッショントークン]今回はなしで
13
+ var c = credentials .NewStaticCredentials (
14
+ os .Getenv (("AWS_ACCESS_KEY" )),
15
+ os .Getenv ("AWS_SECRET_ACCESS_KEY" ),
16
+ "" ,
17
+ ) // 最後の引数は[セッショントークン]今回はなしで
14
18
15
19
var db = dynamo .New (session .New (), & aws.Config {
16
20
Credentials : c ,
@@ -22,7 +26,7 @@ var table = db.Table(os.Getenv("DYNAMO_TABLE"))
22
26
func GetLatestDataFromDynamoDB (machineNO string ) (* model.IoTTable , error ) {
23
27
record := & model.IoTTable {}
24
28
25
- if err := table .Get ("no" , machineNO ).All (record ); err != nil {
29
+ if err := table .Get ("no" , machineNO ).One (record ); err != nil {
26
30
return nil , err
27
31
}
28
32
You can’t perform that action at this time.
0 commit comments