go switch 例

		switch messageType {
		case "system": //系统通知
			return config.System
		case "private": //私信通知
			return config.Private
		case "comment": //评论/回复 ok
			return config.Comment
		case "like": //赞 ok
			return config.Like
		case "reward": //赞赏
			return config.Reward
		case "follower": //关注 ok
			return config.Follower
		case "dynamic": //关注人动态
			return config.Dynamic
		default:
			return true
		}

 

你可能感兴趣的:(go)