# HostEnvironment.IsEnvironment

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [HostEnvironment](/reference/api/go/aspire.hosting/hostenvironment.md)
- Version: `17.0.0`
- Kind: `method`

Checks if the environment matches the specified name.

## Definition

```go
type HostEnvironment interface {
    // ... omitted for brevity
    IsEnvironment(environmentName string) (bool, error)
}
```

## Signature

```go
IsEnvironment(environmentName string) (bool, error)
```

## Parameters

- `environmentName` (`string`) -- The environment name to compare against.

## Returns

`(bool, error)` -- True if the environment matches the specified name.

Returns `(bool, error)`.

## Defined on

- [HostEnvironment](/reference/api/go/aspire.hosting/hostenvironment.md) -- `interface`
