yuchen16

第 7599 号会员 /

回复了 if_chen 创建的主题: go 的内存管理

类似python采用引用计数的方式来管理变量

回复了 aaaaaaaa 创建的主题: go如何实现多行字符串?

可以这样写:

content := `
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: redis-deployment
spec:
  replicas: 1 # tells deployment to run 1 pods matching the template
  template: # create pods using pod definition in this template
    metadata:
      labels:
        app: redis
    spec:
      containers:
      - name: redis
        image: redis:3.0
        ports:
        - containerPort: 6379
        imagePullPolicy: IfNotPresent
---
kind: Service
apiVersion: v1
metadata:
  name: redis-service
spec:
  selector:
    app: redis
  ports:
    - protocol: TCP
      port: 6379
      targetPort: 6379
`