(ctx *Context)
| 16 | } |
| 17 | |
| 18 | func (s *ShowActorCmd) Run(ctx *Context) error { |
| 19 | db, err := gorm.Open(ctx.Dialector, &ctx.Config) |
| 20 | if err != nil { |
| 21 | return err |
| 22 | } |
| 23 | |
| 24 | actor, err := models.NewActors(db).FindByURI(s.Actor) |
| 25 | if err != nil { |
| 26 | return fmt.Errorf("failed to find actor %s: %w", s.Actor, err) |
| 27 | } |
| 28 | |
| 29 | req, _ := http.NewRequest("GET", actor.URI, nil) |
| 30 | ser := mastodon.NewSerialiser(req) |
| 31 | return json.MarshalFull(os.Stdout, ser.Account(actor)) |
| 32 | } |
nothing calls this directly
no test coverage detected