小编Shi*_*gGo的帖子

如何在 CloudWatch 中查看 AWS CloudFormation 日志?

我无法在 CloudFormation 控制台中查看 CloudFormation 堆栈集操作日志。尽管每个堆栈集操作都有一个“操作 ID”,但是否可以在 CloudWatch 中查看日志?或者某种方法来打开日志记录?

amazon-web-services aws-cloudformation

13
推荐指数
1
解决办法
5930
查看次数

从 Go 中的通道接收值

为什么不将go sum(s[len(s)/2:], c)(第二个)返回的最后一个结果分配给x?这两个<-c让我很困惑。此代码来自A Tour of Go - [Channels]

package main

import "fmt"

func sum(s []int, c chan int) {   // int is the return value type
  sum := 0
  for _, v := range s {
    sum += v
  }
  c <- sum // Sends sum to c
}

func main() {
  s := []int{7, 2, 8, -9, 4, 0}

  c := make(chan int)
  go sum(s[:len(s)/2], c)
  go sum(s[len(s)/2:], c)

  x, y …
Run Code Online (Sandbox Code Playgroud)

channel go goroutine

1
推荐指数
1
解决办法
1701
查看次数