package main import ( "log" "os" "strings" ) // cardWideTableGroupingMode returns the configured handling of over-wide answer // tables (see dingtalk.tableGroupingForMode): // // unset / on → grouped list on every frame (historical behaviour) // off → real tables on every frame // stream → grouped list while streaming, real table on the final frame // // The default stays "on" so an environment without the variable renders exactly // as before; DINGTALK_CARD_WIDE_TABLE_GROUP selects the other modes. func cardWideTableGroupingMode() string { mode := strings.ToLower(strings.TrimSpace(os.Getenv("DINGTALK_CARD_WIDE_TABLE_GROUP"))) switch mode { case "off", "0", "false", "no", "stream", "streaming", "partial": log.Printf("DingTalk wide-table grouping mode=%s", mode) return mode default: return "" } }