Skip to content

📊 Status ​

Shows the local modifications of installed dependencies (runs composer status).

When to use ​

Use this when you need to quickly check whether dependencies in the vendor directory have been manually modified, e.g. when investigating "why production behavior differs from the source code".

Signature ​

go
func (c *Composer) Status() (string, error)

Parameters ​

ParameterTypeDescription
None—This method takes no parameters

Return value ​

  • string: the raw output text of composer status
  • error: returned when the command fails to execute

Example ​

go
package main

import (
    "fmt"
    "log"

    "github.com/scagogogo/composer-skills/pkg/composer"
)

func main() {
    comp, err := composer.New(composer.DefaultOptions())
    if err != nil {
        log.Fatal(err)
    }

    output, err := comp.Status()
    if err != nil {
        log.Fatalf("query status failed: %v", err)
    }
    fmt.Println(output)
}

Advanced ​

  • For structured results (whether modified, list of modified files), use StatusStructured
  • For additional options (e.g. --verbose), use StatusWithOptions (see diagnosis.go)
  • To view global dependency status, use GlobalStatus (see global.go)

Released under the MIT License