本文整理汇总了Golang中fmt.Sprintln函数的典型用法代码示例。如果您正苦于以下问题:Golang Sprintln函数的具体用法?Golang Sprintln怎么用?Golang Sprintln使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了Sprintln函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: Error

func (in *Input) Error(args ...interface{}) {
    if panicOnError {
        panic(fmt.Errorf("%s:%d: %s", in.File(), in.Line(), fmt.Sprintln(args...)))
    }
    fmt.Fprintf(os.Stderr, "%s:%d: %s", in.File(), in.Line(), fmt.Sprintln(args...))
    os.Exit(1)
}

开发者ID:danny8002,项目名称:go,代码行数:7,代码来源:input.go

示例2: Start

func (e *Engine) Start() {
    var err error

    e.shader.program, err = LoadProgram("shader.v.glsl", "shader.f.glsl")
    if err != nil {
        panic(fmt.Sprintln("LoadProgram failed:", err))
    }

    e.shape.buf = gl.CreateBuffer()
    gl.BindBuffer(gl.ARRAY_BUFFER, e.shape.buf)
    gl.BufferData(gl.ARRAY_BUFFER, EncodeObject(cubeData), gl.STATIC_DRAW)

    e.shader.vertCoord = gl.GetAttribLocation(e.shader.program, "vertCoord")
    e.shader.vertTexCoord = gl.GetAttribLocation(e.shader.program, "vertTexCoord")

    e.shader.projection = gl.GetUniformLocation(e.shader.program, "projection")
    e.shader.view = gl.GetUniformLocation(e.shader.program, "view")
    e.shader.model = gl.GetUniformLocation(e.shader.program, "model")

    e.shape.texture, err = LoadTexture("gopher.png")
    if err != nil {
        panic(fmt.Sprintln("LoadTexture failed:", err))
    }

    e.started = time.Now()
}

开发者ID:lovexiaov,项目名称:gomobileapp,代码行数:26,代码来源:main.go

示例3: String

func (p *PackageDeprecated) String() string {
    return fmt.Sprintln("   root:", p.root) +
        fmt.Sprintln("   name:", p.name) +
        fmt.Sprintln("version:", p.version) +
        fmt.Sprintln(" source:", p.Source) +
        fmt.Sprintln(" tmpdir:", p.tmpdir)
}

开发者ID:hfeeki,项目名称:gpkg,代码行数:7,代码来源:package_deprecated.go

示例4: String

func (this DepthMap) String() string {
    s := fmt.Sprintln("Depths", len(this))
    for _, dData := range this {
        s += fmt.Sprintln("Depth:", dData.depth, "Items:", len(dData.array))
    }
    return s
}

开发者ID:gulinfang,项目名称:GarageEngine,代码行数:7,代码来源:DepthMap.go

示例5: runPrune

func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed uint64, output string, err error) {
    pruneFilters := opts.filter.Value()
    pruneFilters.Add("dangling", fmt.Sprintf("%v", !opts.all))

    warning := danglingWarning
    if opts.all {
        warning = allImageWarning
    }
    if !opts.force && !command.PromptForConfirmation(dockerCli.In(), dockerCli.Out(), warning) {
        return
    }

    report, err := dockerCli.Client().ImagesPrune(context.Background(), pruneFilters)
    if err != nil {
        return
    }

    if len(report.ImagesDeleted) > 0 {
        output = "Deleted Images:\n"
        for _, st := range report.ImagesDeleted {
            if st.Untagged != "" {
                output += fmt.Sprintln("untagged:", st.Untagged)
            } else {
                output += fmt.Sprintln("deleted:", st.Deleted)
            }
        }
        spaceReclaimed = report.SpaceReclaimed
    }

    return
}

开发者ID:docker,项目名称:docker,代码行数:31,代码来源:prune.go

最后编辑: kuteng  文档更新时间: 2021-08-23 19:14   作者:kuteng