aboutsummaryrefslogtreecommitdiff
path: root/Sources/Helpers.swift
blob: 8481347816155440165deeff49f7a9ecff4b7df4 (plain)
1
2
3
4
5
6
7
8
9
import Foundation

let versionString = "generated and served by swift-gopher/1.0.0" // TODO: Handle automatic versioning

func buildVersionStringResponse() -> String {
    let repeatedString = "i" + String(repeating: "-", count: 80) + "\terror.host\t1\r\n"
    let versionResponseString = "i" + String(repeating: " ", count: 80 - versionString.count) + versionString + "\terror.host\t1\r\n"
    return "\(repeatedString)\(versionResponseString)"
}